diff options
author | Vlad Yaroslavlev <vladon@vladon.com> | 2022-02-10 16:46:25 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:25 +0300 |
commit | 344ea37b4a345701ab0e67de2266a1c1bd7baf2d (patch) | |
tree | 1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /library/cpp/scheme/tests/ut | |
parent | 706b83ed7de5a473436620367af31fc0ceecde07 (diff) | |
download | ydb-344ea37b4a345701ab0e67de2266a1c1bd7baf2d.tar.gz |
Restoring authorship annotation for Vlad Yaroslavlev <vladon@vladon.com>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/scheme/tests/ut')
-rw-r--r-- | library/cpp/scheme/tests/ut/scheme_cast_ut.cpp | 32 | ||||
-rw-r--r-- | library/cpp/scheme/tests/ut/scheme_json_ut.cpp | 4 | ||||
-rw-r--r-- | library/cpp/scheme/tests/ut/scheme_path_ut.cpp | 20 | ||||
-rw-r--r-- | library/cpp/scheme/tests/ut/scheme_proto_ut.cpp | 2 | ||||
-rw-r--r-- | library/cpp/scheme/tests/ut/scheme_ut.cpp | 40 |
5 files changed, 49 insertions, 49 deletions
diff --git a/library/cpp/scheme/tests/ut/scheme_cast_ut.cpp b/library/cpp/scheme/tests/ut/scheme_cast_ut.cpp index 7f9101eff4..4f907157e9 100644 --- a/library/cpp/scheme/tests/ut/scheme_cast_ut.cpp +++ b/library/cpp/scheme/tests/ut/scheme_cast_ut.cpp @@ -9,11 +9,11 @@ using namespace NJsonConverters; -using TVI = TVector<int>; -using THI = THashMap<int, int>; -using TMI = TMap<int, int>; -using THSI = THashSet<int>; -using TSI = TSet<int>; +using TVI = TVector<int>; +using THI = THashMap<int, int>; +using TMI = TMap<int, int>; +using THSI = THashSet<int>; +using TSI = TSet<int>; using TPI = std::pair<int, int>; Y_UNIT_TEST_SUITE(TSchemeCastTest) { @@ -34,7 +34,7 @@ Y_UNIT_TEST_SUITE(TSchemeCastTest) { for (int i = 0; i < 3; ++i) h[i] = i * i; - const TString etalon = "{\"0\":0,\"1\":1,\"2\":4}"; + const TString etalon = "{\"0\":0,\"1\":1,\"2\":4}"; UNIT_ASSERT_VALUES_EQUAL(etalon, ToJson(h, true)); THI h2(FromJson<THI>(ToJson(h))); @@ -46,7 +46,7 @@ Y_UNIT_TEST_SUITE(TSchemeCastTest) { for (int i = 0; i < 3; ++i) h[i] = i * i; - const TString etalon = "{\"0\":0,\"1\":1,\"2\":4}"; + const TString etalon = "{\"0\":0,\"1\":1,\"2\":4}"; UNIT_ASSERT_VALUES_EQUAL(etalon, ToJson(h, true)); TMI h2(FromJson<TMI>(ToJson(h))); @@ -58,7 +58,7 @@ Y_UNIT_TEST_SUITE(TSchemeCastTest) { for (int i = 0; i < 3; ++i) h.insert(i * i); - const TString etalon = "{\"0\":null,\"1\":null,\"4\":null}"; + const TString etalon = "{\"0\":null,\"1\":null,\"4\":null}"; UNIT_ASSERT_VALUES_EQUAL(etalon, ToJson(h, true)); THSI h2(FromJson<THSI>(ToJson(h))); @@ -70,7 +70,7 @@ Y_UNIT_TEST_SUITE(TSchemeCastTest) { for (int i = 0; i < 3; ++i) h.insert(i * i); - const TString etalon = "{\"0\":null,\"1\":null,\"4\":null}"; + const TString etalon = "{\"0\":null,\"1\":null,\"4\":null}"; UNIT_ASSERT_VALUES_EQUAL(etalon, ToJson(h, true)); TSI h2(FromJson<TSI>(ToJson(h))); @@ -80,7 +80,7 @@ Y_UNIT_TEST_SUITE(TSchemeCastTest) { Y_UNIT_TEST(TestTPair) { TPI p(1, 1); - const TString etalon = "[1,1]"; + const TString etalon = "[1,1]"; UNIT_ASSERT_VALUES_EQUAL(etalon, ToJson(p, true)); TPI p2(FromJson<TPI>(ToJson(p))); @@ -116,7 +116,7 @@ Y_UNIT_TEST_SUITE(TSchemeCastTest) { Y_UNIT_TEST(TestTCustom) { TCustom x(2, 3); - const TString etalon = "{\"a\":2,\"b\":3}"; + const TString etalon = "{\"a\":2,\"b\":3}"; UNIT_ASSERT_VALUES_EQUAL(etalon, ToJson(x, true)); TCustom x2(FromJson<TCustom>(ToJson(x))); @@ -124,13 +124,13 @@ Y_UNIT_TEST_SUITE(TSchemeCastTest) { } Y_UNIT_TEST(TestVectorOfPairs) { - typedef TVector<TPI> TVPI; + typedef TVector<TPI> TVPI; TVPI v; for (int i = 0; i < 3; ++i) v.push_back(TPI(i, i * i)); - const TString etalon = "[[0,0],[1,1],[2,4]]"; + const TString etalon = "[[0,0],[1,1],[2,4]]"; UNIT_ASSERT_VALUES_EQUAL(etalon, ToJson(v, true)); TVPI v2(FromJson<TVPI>(ToJson(v))); @@ -138,11 +138,11 @@ Y_UNIT_TEST_SUITE(TSchemeCastTest) { } Y_UNIT_TEST(TestSetOfCustom) { - typedef TSet<TCustom> TSC; + typedef TSet<TCustom> TSC; TSC s; s.insert(TCustom(2, 3)); - const TString etalon = "{\"{\\\"a\\\":2,\\\"b\\\":3}\":null}"; + const TString etalon = "{\"{\\\"a\\\":2,\\\"b\\\":3}\":null}"; UNIT_ASSERT_VALUES_EQUAL(etalon, ToJson(s, true)); TSC s2(FromJson<TSC>(ToJson(s))); @@ -151,7 +151,7 @@ Y_UNIT_TEST_SUITE(TSchemeCastTest) { Y_UNIT_TEST(TestExceptions) { NSc::TValue v = 1; - const TString json = v.ToJson(); + const TString json = v.ToJson(); UNIT_ASSERT_EXCEPTION(FromJson<TVI>(json, true), yexception); UNIT_ASSERT_EXCEPTION(FromJson<THI>(json, true), yexception); UNIT_ASSERT_EXCEPTION(FromJson<TMI>(json, true), yexception); diff --git a/library/cpp/scheme/tests/ut/scheme_json_ut.cpp b/library/cpp/scheme/tests/ut/scheme_json_ut.cpp index 7b248299d6..daeb2654f9 100644 --- a/library/cpp/scheme/tests/ut/scheme_json_ut.cpp +++ b/library/cpp/scheme/tests/ut/scheme_json_ut.cpp @@ -69,7 +69,7 @@ Y_UNIT_TEST_SUITE(TSchemeJsonTest) { } Y_UNIT_TEST(TestSafeJson) { - TString ss; + TString ss; ss.reserve(256); for (int i = 0; i < 256; ++i) { @@ -114,7 +114,7 @@ Y_UNIT_TEST_SUITE(TSchemeJsonTest) { { NSc::TValue value; - TString articleName{"\xC2\xC2\xCF"}; + TString articleName{"\xC2\xC2\xCF"}; value["text"] = articleName; UNIT_ASSERT_VALUES_EQUAL(value.ToJson(), "{\"text\":\"\xC2\xC2\xCF\"}"); UNIT_ASSERT_VALUES_EQUAL(value.ToJsonSafe(), "{\"text\":null}"); diff --git a/library/cpp/scheme/tests/ut/scheme_path_ut.cpp b/library/cpp/scheme/tests/ut/scheme_path_ut.cpp index 7b95f02d13..0d4d79d483 100644 --- a/library/cpp/scheme/tests/ut/scheme_path_ut.cpp +++ b/library/cpp/scheme/tests/ut/scheme_path_ut.cpp @@ -98,61 +98,61 @@ Y_UNIT_TEST_SUITE(TSchemePathTest) { { NSc::TValue val; *val.TrySelectOrAdd("") = 100; - const TString res = R"=(100)="; + const TString res = R"=(100)="; UNIT_ASSERT_VALUES_EQUAL(val.ToJson(), res); } { NSc::TValue val; *val.TrySelectOrAdd("a") = 100; - const TString res = R"=({"a":100})="; + const TString res = R"=({"a":100})="; UNIT_ASSERT_VALUES_EQUAL(val.ToJson(), res); } { NSc::TValue val; *val.TrySelectOrAdd(R"=(////)=") = 100; - const TString res = R"=(100)="; + const TString res = R"=(100)="; UNIT_ASSERT_VALUES_EQUAL(val.ToJson(), res); } { NSc::TValue val; *val.TrySelectOrAdd(R"=()=") = 100; - const TString res = R"=(100)="; + const TString res = R"=(100)="; UNIT_ASSERT_VALUES_EQUAL(val.ToJson(), res); } { NSc::TValue val; *val.TrySelectOrAdd(R"=("")=") = 100; - const TString res = R"=({"":100})="; + const TString res = R"=({"":100})="; UNIT_ASSERT_VALUES_EQUAL(val.ToJson(), res); } { NSc::TValue val; *val.TrySelectOrAdd(R"=("[1]")=") = 100; - const TString res = R"=({"[1]":100})="; + const TString res = R"=({"[1]":100})="; UNIT_ASSERT_VALUES_EQUAL(val.ToJson(), res); } { NSc::TValue val; *val.TrySelectOrAdd(R"=("\"\"")=") = 100; - const TString res = R"=({"\"\"":100})="; + const TString res = R"=({"\"\"":100})="; UNIT_ASSERT_VALUES_EQUAL(val.ToJson(), res); } { NSc::TValue val; *val.TrySelectOrAdd(R"=("/10/")=") = 100; - const TString res = R"=({"/10/":100})="; + const TString res = R"=({"/10/":100})="; UNIT_ASSERT_VALUES_EQUAL(val.ToJson(), res); } { NSc::TValue val; *val.TrySelectOrAdd(R"=(/"[10]"//""/"\"/10/\""///)=") = 100; - const TString res = R"=({"[10]":{"":{"\"/10/\"":100}}})="; + const TString res = R"=({"[10]":{"":{"\"/10/\"":100}}})="; UNIT_ASSERT_VALUES_EQUAL(val.ToJson(), res); } { NSc::TValue val; *val.TrySelectOrAdd(R"=(/"[10]"//""/"\"/10/\""///)=") = 100; - const TString res = R"=({"[10]":{"":{"\"/10/\"":100}}})="; + const TString res = R"=({"[10]":{"":{"\"/10/\"":100}}})="; UNIT_ASSERT_VALUES_EQUAL(val.ToJson(), res); } } diff --git a/library/cpp/scheme/tests/ut/scheme_proto_ut.cpp b/library/cpp/scheme/tests/ut/scheme_proto_ut.cpp index db8d13b978..e711a0d092 100644 --- a/library/cpp/scheme/tests/ut/scheme_proto_ut.cpp +++ b/library/cpp/scheme/tests/ut/scheme_proto_ut.cpp @@ -213,7 +213,7 @@ Y_UNIT_TEST_SUITE(TSchemeProtoTest) { NSc::TMessage proto; v.To(proto); - TString differentPath; + TString differentPath; UNIT_ASSERT_C(NProtoBuf::IsEqual(m, proto, &differentPath), differentPath); } } diff --git a/library/cpp/scheme/tests/ut/scheme_ut.cpp b/library/cpp/scheme/tests/ut/scheme_ut.cpp index 290ebd6c04..1a5d07c31b 100644 --- a/library/cpp/scheme/tests/ut/scheme_ut.cpp +++ b/library/cpp/scheme/tests/ut/scheme_ut.cpp @@ -241,7 +241,7 @@ Y_UNIT_TEST_SUITE(TSchemeTest) { Y_UNIT_TEST(TestAssignments) { for (int i = -2; i < 3; ++i) { - TString ii = ToString(i); + TString ii = ToString(i); int iless = i - 1; int imore = i + 1; DoCheckAssignmentNum<signed char>(i, iless, imore, ii, "schar"); @@ -262,7 +262,7 @@ Y_UNIT_TEST_SUITE(TSchemeTest) { // DoCheckAssignment<bool>(false, false, false, "false", "bool"); for (int i = 1; i < 3; ++i) { - TString ii = ToString(i); + TString ii = ToString(i); int iless = i - 1; int imore = i + 1; @@ -292,9 +292,9 @@ Y_UNIT_TEST_SUITE(TSchemeTest) { DoCheckAssignmentNum<double>(i, iless, imore, ii, "double"); } - TString uuu = "uuu"; - TString uua = "uua"; - TString uuz = "uuz"; + TString uuu = "uuu"; + TString uua = "uua"; + TString uuz = "uuz"; DoCheckAssignment<char*>(uuu.begin(), uua.begin(), uuz.begin(), "\"uuu\"", "char*"); DoCheckAssignment<const char*>("www", "wwa", "wwz", "\"www\"", "const char*"); DoCheckAssignmentArr("xxx", "xxa", "xxz", "\"xxx\"", "const char[]"); @@ -303,7 +303,7 @@ Y_UNIT_TEST_SUITE(TSchemeTest) { #if defined(_MSC_VER) //TODO #else - DoCheckAssignment<TString>("ttt", "tta", "ttz", "\"ttt\"", "TString"); + DoCheckAssignment<TString>("ttt", "tta", "ttz", "\"ttt\"", "TString"); #endif NSc::TValue v; @@ -358,12 +358,12 @@ Y_UNIT_TEST_SUITE(TSchemeTest) { v.AppendAll(d); UNIT_ASSERT_VALUES_EQUAL(v.ToJson(), R"(["a","b","c","d",1,2,3,4,5,6])"); UNIT_ASSERT_VALUES_EQUAL(d.size(), 3u); - TVector<TStringBuf> s{"x", "y", "z"}; + TVector<TStringBuf> s{"x", "y", "z"}; v.AppendAll(s.begin(), s.end()); UNIT_ASSERT_VALUES_EQUAL(v.ToJson(), R"(["a","b","c","d",1,2,3,4,5,6,"x","y","z"])"); UNIT_ASSERT_VALUES_EQUAL(v.Clone().Clear().AppendAll(s).ToJson(), R"(["x","y","z"])"); - UNIT_ASSERT_VALUES_EQUAL(v.Clone().Clear().AppendAll(TVector<TStringBuf>()).ToJson(), R"([])"); + UNIT_ASSERT_VALUES_EQUAL(v.Clone().Clear().AppendAll(TVector<TStringBuf>()).ToJson(), R"([])"); v.AddAll({{"a", "b"}, {"c", "d"}}); UNIT_ASSERT_VALUES_EQUAL(v.ToJson(), R"({"a":"b","c":"d"})"); @@ -421,10 +421,10 @@ Y_UNIT_TEST_SUITE(TSchemeTest) { NSc::TValue va = NSc::TValue::FromJson("[ x, y]"); NSc::TValue vs = NSc::TValue::FromJson("foo"); NSc::TValue vn = NSc::TValue::FromJson("1"); - TString sd = "{\"a\":1,\"b\":\"c\"}"; - TString sa = "[\"x\",\"y\"]"; - TString ss = "\"foo\""; - TString sn = "1"; + TString sd = "{\"a\":1,\"b\":\"c\"}"; + TString sa = "[\"x\",\"y\"]"; + TString ss = "\"foo\""; + TString sn = "1"; UNIT_ASSERT_VALUES_EQUAL(sd, vd.ToJson(true)); UNIT_ASSERT_VALUES_EQUAL(sa, va.ToJson(true)); UNIT_ASSERT_VALUES_EQUAL(ss, vs.ToJson(true)); @@ -781,7 +781,7 @@ Y_UNIT_TEST_SUITE(TSchemeTest) { Y_UNIT_TEST(TestCopyFrom) { { - TString sa = "[1,2]"; + TString sa = "[1,2]"; const NSc::TValue& va = NSc::TValue::FromJson(sa); NSc::TValue vb = va; vb.CopyFrom(va); @@ -789,7 +789,7 @@ Y_UNIT_TEST_SUITE(TSchemeTest) { UNIT_ASSERT_VALUES_EQUAL(vb.ToJson(), sa); } { - TString sa = "[1,2]"; + TString sa = "[1,2]"; NSc::TValue va = NSc::TValue::FromJson(sa); NSc::TValue vb = va; vb.CopyFrom(va); @@ -797,7 +797,7 @@ Y_UNIT_TEST_SUITE(TSchemeTest) { UNIT_ASSERT_VALUES_EQUAL(vb.ToJson(), sa); } { - TString sa = "[1,2]"; + TString sa = "[1,2]"; NSc::TValue va = NSc::TValue::FromJson(sa); const NSc::TValue& vb = va; va.CopyFrom(vb); @@ -805,7 +805,7 @@ Y_UNIT_TEST_SUITE(TSchemeTest) { UNIT_ASSERT_VALUES_EQUAL(vb.ToJson(), sa); } { - TString sa = "[1,2]"; + TString sa = "[1,2]"; NSc::TValue va = NSc::TValue::FromJson(sa); NSc::TValue vb = va; va.CopyFrom(vb); @@ -816,7 +816,7 @@ Y_UNIT_TEST_SUITE(TSchemeTest) { NSc::TValue va = NSc::TValue::FromJson("{\"x\":\"ab\",\"y\":{\"p\":\"cd\",\"q\":\"ef\"}}"); NSc::TValue vb = va.Get("y"); va.CopyFrom(vb); - TString sa = "{\"p\":\"cd\",\"q\":\"ef\"}"; + TString sa = "{\"p\":\"cd\",\"q\":\"ef\"}"; UNIT_ASSERT_VALUES_EQUAL(va.ToJson(), sa); UNIT_ASSERT_VALUES_EQUAL(vb.ToJson(), sa); } @@ -824,14 +824,14 @@ Y_UNIT_TEST_SUITE(TSchemeTest) { NSc::TValue va = NSc::TValue::FromJson("{\"x\":\"ab\",\"y\":{\"p\":\"cd\",\"q\":\"ef\"}}"); const NSc::TValue& vb = va.Get("y"); va.CopyFrom(vb); - TString sa = "{\"p\":\"cd\",\"q\":\"ef\"}"; + TString sa = "{\"p\":\"cd\",\"q\":\"ef\"}"; UNIT_ASSERT_VALUES_EQUAL(va.ToJson(), sa); } { NSc::TValue va = NSc::TValue::FromJson("{\"x\":\"ab\",\"y\":{\"p\":\"cd\",\"q\":\"ef\"}}"); NSc::TValue vb = va.Get("y"); va = vb; - TString sa = "{\"p\":\"cd\",\"q\":\"ef\"}"; + TString sa = "{\"p\":\"cd\",\"q\":\"ef\"}"; UNIT_ASSERT_VALUES_EQUAL(va.ToJson(), sa); UNIT_ASSERT_VALUES_EQUAL(vb.ToJson(), sa); } @@ -839,7 +839,7 @@ Y_UNIT_TEST_SUITE(TSchemeTest) { NSc::TValue va = NSc::TValue::FromJson("{\"x\":\"ab\",\"y\":{\"p\":\"cd\",\"q\":\"ef\"}}"); const NSc::TValue& vb = va.Get("y"); va = vb; - TString sa = "{\"p\":\"cd\",\"q\":\"ef\"}"; + TString sa = "{\"p\":\"cd\",\"q\":\"ef\"}"; UNIT_ASSERT_VALUES_EQUAL(va.ToJson(), sa); UNIT_ASSERT_VALUES_EQUAL(vb.ToJson(), sa); } |