summaryrefslogtreecommitdiffstats
path: root/library/cpp/json/writer/json_value_ut.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'library/cpp/json/writer/json_value_ut.cpp')
-rw-r--r--library/cpp/json/writer/json_value_ut.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/library/cpp/json/writer/json_value_ut.cpp b/library/cpp/json/writer/json_value_ut.cpp
index 21b396a64de..e804e541ccf 100644
--- a/library/cpp/json/writer/json_value_ut.cpp
+++ b/library/cpp/json/writer/json_value_ut.cpp
@@ -682,4 +682,12 @@ Y_UNIT_TEST_SUITE(TJsonValueTest) {
UNIT_ASSERT_VALUES_EQUAL(filled["4"].GetMapSafe().size(), 1);
UNIT_ASSERT_VALUES_EQUAL(filled["4"]["5"], TJsonValue{5});
}
+
+ Y_UNIT_TEST(GetStringSafeTest) {
+ TJsonValue json;
+ json["key"] = "value";
+ TString& valueRef = json["key"].GetStringSafe();
+ valueRef = "new_value";
+ UNIT_ASSERT_VALUES_EQUAL(json["key"].GetString(), "new_value");
+ }
} // Y_UNIT_TEST_SUITE(TJsonValueTest)