aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/scheme
diff options
context:
space:
mode:
authortobo <tobo@yandex-team.ru>2022-02-10 16:47:27 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:47:27 +0300
commit7fe839092527589b38f014d854c51565b3c1adfa (patch)
tree309e97022d3530044b712b8f71318c78faf7856e /library/cpp/scheme
parentd0d68c395c10da4cb56a1c845504570a04d7893e (diff)
downloadydb-7fe839092527589b38f014d854c51565b3c1adfa.tar.gz
Restoring authorship annotation for <tobo@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/scheme')
-rw-r--r--library/cpp/scheme/scimpl_json_write.cpp10
-rw-r--r--library/cpp/scheme/tests/fuzz_ops/ut/vm_parse_ut.cpp70
-rw-r--r--library/cpp/scheme/tests/ut/scheme_cast_ut.cpp2
-rw-r--r--library/cpp/scheme/tests/ut/scheme_json_ut.cpp6
-rw-r--r--library/cpp/scheme/tests/ut/scheme_merge_ut.cpp6
5 files changed, 47 insertions, 47 deletions
diff --git a/library/cpp/scheme/scimpl_json_write.cpp b/library/cpp/scheme/scimpl_json_write.cpp
index aadd7e6cd5..164ccbec31 100644
--- a/library/cpp/scheme/scimpl_json_write.cpp
+++ b/library/cpp/scheme/scimpl_json_write.cpp
@@ -70,7 +70,7 @@ namespace NSc {
NImpl::TSelfLoopContext::TGuard loopCheck(loopCtx, core);
if (!loopCheck.Ok) {
- out << TStringBuf("null"); // a loop encountered (and asserted), skip the back reference
+ out << TStringBuf("null"); // a loop encountered (and asserted), skip the back reference
return;
}
@@ -80,11 +80,11 @@ namespace NSc {
[[fallthrough]]; /* no break */
}
case EType::Null: {
- out << TStringBuf("null");
+ out << TStringBuf("null");
break;
}
case EType::Bool: {
- out << (core.IntNumber ? TStringBuf("true") : TStringBuf("false"));
+ out << (core.IntNumber ? TStringBuf("true") : TStringBuf("false"));
break;
}
case EType::IntNumber: {
@@ -96,7 +96,7 @@ namespace NSc {
if (!jopts.NumberPolicy || jopts.NumberPolicy(d)) {
out << d;
} else {
- out << TStringBuf("null");
+ out << TStringBuf("null");
}
break;
}
@@ -105,7 +105,7 @@ namespace NSc {
if (!jopts.StringPolicy || jopts.StringPolicy(s)) {
WriteString(out, s);
} else {
- out << TStringBuf("null");
+ out << TStringBuf("null");
}
break;
}
diff --git a/library/cpp/scheme/tests/fuzz_ops/ut/vm_parse_ut.cpp b/library/cpp/scheme/tests/fuzz_ops/ut/vm_parse_ut.cpp
index ce3786a671..9a1a4fa738 100644
--- a/library/cpp/scheme/tests/fuzz_ops/ut/vm_parse_ut.cpp
+++ b/library/cpp/scheme/tests/fuzz_ops/ut/vm_parse_ut.cpp
@@ -48,27 +48,27 @@ Y_UNIT_TEST_SUITE(TestParseNextAction) {
Y_UNIT_TEST(TestParsePos) {
DoTestParsePosFailure("", 1, 0);
- UNIT_ASSERT_VALUES_EQUAL(DoTestParsePosSuccess(TStringBuf("\x00"sv), 1, 0), 0);
- UNIT_ASSERT_VALUES_EQUAL(DoTestParsePosSuccess(TStringBuf("\x01"sv), 1, 0), 0);
+ UNIT_ASSERT_VALUES_EQUAL(DoTestParsePosSuccess(TStringBuf("\x00"sv), 1, 0), 0);
+ UNIT_ASSERT_VALUES_EQUAL(DoTestParsePosSuccess(TStringBuf("\x01"sv), 1, 0), 0);
- DoTestParsePosFailure(TStringBuf("\x02"sv), 1, 0);
- DoTestParsePosFailure(TStringBuf("\x03"sv), 2, 0);
+ DoTestParsePosFailure(TStringBuf("\x02"sv), 1, 0);
+ DoTestParsePosFailure(TStringBuf("\x03"sv), 2, 0);
- UNIT_ASSERT_VALUES_EQUAL(DoTestParsePosSuccess(TStringBuf("\x02"sv), 2, 0), 1);
- UNIT_ASSERT_VALUES_EQUAL(DoTestParsePosSuccess(TStringBuf("\x03"sv), 2, 1), 0);
+ UNIT_ASSERT_VALUES_EQUAL(DoTestParsePosSuccess(TStringBuf("\x02"sv), 2, 0), 1);
+ UNIT_ASSERT_VALUES_EQUAL(DoTestParsePosSuccess(TStringBuf("\x03"sv), 2, 1), 0);
- UNIT_ASSERT_VALUES_EQUAL(DoTestParsePosSuccess(TStringBuf("\x0E"sv), 8, 0), 7);
- UNIT_ASSERT_VALUES_EQUAL(DoTestParsePosSuccess(TStringBuf("\x0F"sv), 8, 7), 0);
+ UNIT_ASSERT_VALUES_EQUAL(DoTestParsePosSuccess(TStringBuf("\x0E"sv), 8, 0), 7);
+ UNIT_ASSERT_VALUES_EQUAL(DoTestParsePosSuccess(TStringBuf("\x0F"sv), 8, 7), 0);
{
- TVMState st{TStringBuf("\xDE\x7B"), 16, 0};
+ TVMState st{TStringBuf("\xDE\x7B"), 16, 0};
UNIT_ASSERT_VALUES_EQUAL(DoTestParsePosSuccess(st), 15);
UNIT_ASSERT_VALUES_EQUAL(DoTestParsePosSuccess(st), 15);
UNIT_ASSERT_VALUES_EQUAL(DoTestParsePosSuccess(st), 15);
UNIT_ASSERT(!ParsePos(st));
}
{
- TVMState st{TStringBuf("\xFF\x7F"), 16, 15};
+ TVMState st{TStringBuf("\xFF\x7F"), 16, 15};
UNIT_ASSERT_VALUES_EQUAL(DoTestParsePosSuccess(st), 0);
UNIT_ASSERT_VALUES_EQUAL(DoTestParsePosSuccess(st), 0);
UNIT_ASSERT_VALUES_EQUAL(DoTestParsePosSuccess(st), 0);
@@ -97,15 +97,15 @@ Y_UNIT_TEST_SUITE(TestParseNextAction) {
Y_UNIT_TEST(TestParseRef) {
DoTestParseRefFailure("", 1, 0);
- UNIT_ASSERT_VALUES_EQUAL(DoTestParseRefSuccess(TStringBuf("\x00"sv), 1, 0), std::make_pair((ui32)-1, TRef::T_CREATE_FRONT));
- UNIT_ASSERT_VALUES_EQUAL(DoTestParseRefSuccess(TStringBuf("\x01"sv), 1, 0), std::make_pair((ui32)-1, TRef::T_CREATE_BACK));
- UNIT_ASSERT_VALUES_EQUAL(DoTestParseRefSuccess(TStringBuf("\x0A"sv), 2, 0), std::make_pair(1u, TRef::T_REF__POS));
+ UNIT_ASSERT_VALUES_EQUAL(DoTestParseRefSuccess(TStringBuf("\x00"sv), 1, 0), std::make_pair((ui32)-1, TRef::T_CREATE_FRONT));
+ UNIT_ASSERT_VALUES_EQUAL(DoTestParseRefSuccess(TStringBuf("\x01"sv), 1, 0), std::make_pair((ui32)-1, TRef::T_CREATE_BACK));
+ UNIT_ASSERT_VALUES_EQUAL(DoTestParseRefSuccess(TStringBuf("\x0A"sv), 2, 0), std::make_pair(1u, TRef::T_REF__POS));
- DoTestParseRefFailure(TStringBuf("\x12"), 1, 0);
- DoTestParseRefFailure(TStringBuf("\x03"sv), 1, 0);
+ DoTestParseRefFailure(TStringBuf("\x12"), 1, 0);
+ DoTestParseRefFailure(TStringBuf("\x03"sv), 1, 0);
{
- TVMState st{TStringBuf("\x7A\x7D"), 16, 0};
+ TVMState st{TStringBuf("\x7A\x7D"), 16, 0};
UNIT_ASSERT_VALUES_EQUAL(DoTestParseRefSuccess(st), std::make_pair(15u, TRef::T_REF__POS));
UNIT_ASSERT_VALUES_EQUAL(DoTestParseRefSuccess(st), std::make_pair(15u, TRef::T_REF__POS));
UNIT_ASSERT_VALUES_EQUAL(DoTestParseRefSuccess(st), std::make_pair((ui32)-1, TRef::T_CREATE_BACK));
@@ -134,14 +134,14 @@ Y_UNIT_TEST_SUITE(TestParseNextAction) {
Y_UNIT_TEST(TestParseSrc) {
DoTestParseSrcFailure("", 1, 0);
- UNIT_ASSERT_VALUES_EQUAL(DoTestParseSrcSuccess(TStringBuf("\x08"sv), 2, 0), std::make_pair(1u, TSrc::T_LREF__POS));
- UNIT_ASSERT_VALUES_EQUAL(DoTestParseSrcSuccess(TStringBuf("\x09"sv), 2, 0), std::make_pair(1u, TSrc::T_CREF__POS));
- UNIT_ASSERT_VALUES_EQUAL(DoTestParseSrcSuccess(TStringBuf("\x0A"sv), 2, 0), std::make_pair(1u, TSrc::T_RREF__POS));
+ UNIT_ASSERT_VALUES_EQUAL(DoTestParseSrcSuccess(TStringBuf("\x08"sv), 2, 0), std::make_pair(1u, TSrc::T_LREF__POS));
+ UNIT_ASSERT_VALUES_EQUAL(DoTestParseSrcSuccess(TStringBuf("\x09"sv), 2, 0), std::make_pair(1u, TSrc::T_CREF__POS));
+ UNIT_ASSERT_VALUES_EQUAL(DoTestParseSrcSuccess(TStringBuf("\x0A"sv), 2, 0), std::make_pair(1u, TSrc::T_RREF__POS));
- DoTestParseSrcFailure(TStringBuf("\x03"sv), 1, 0);
+ DoTestParseSrcFailure(TStringBuf("\x03"sv), 1, 0);
{
- TVMState st{TStringBuf("\x7A\x7D"), 16, 0};
+ TVMState st{TStringBuf("\x7A\x7D"), 16, 0};
UNIT_ASSERT_VALUES_EQUAL(DoTestParseSrcSuccess(st), std::make_pair(15u, TSrc::T_RREF__POS));
UNIT_ASSERT_VALUES_EQUAL(DoTestParseSrcSuccess(st), std::make_pair(15u, TSrc::T_RREF__POS));
UNIT_ASSERT(!ParseSrc(st));
@@ -169,21 +169,21 @@ Y_UNIT_TEST_SUITE(TestParseNextAction) {
Y_UNIT_TEST(TestParseDst) {
DoTestParseDstFailure("", 1, 0);
- UNIT_ASSERT_VALUES_EQUAL(DoTestParseDstSuccess(TStringBuf("\x00"sv), 1, 0), std::make_pair((ui32)-1, TDst::T_CREATE_FRONT_LREF));
- UNIT_ASSERT_VALUES_EQUAL(DoTestParseDstSuccess(TStringBuf("\x01"sv), 1, 0), std::make_pair((ui32)-1, TDst::T_CREATE_FRONT_CREF));
- UNIT_ASSERT_VALUES_EQUAL(DoTestParseDstSuccess(TStringBuf("\x02"sv), 1, 0), std::make_pair((ui32)-1, TDst::T_CREATE_FRONT_RREF));
- UNIT_ASSERT_VALUES_EQUAL(DoTestParseDstSuccess(TStringBuf("\x03"sv), 1, 0), std::make_pair((ui32)-1, TDst::T_CREATE_BACK_LREF));
- UNIT_ASSERT_VALUES_EQUAL(DoTestParseDstSuccess(TStringBuf("\x04"sv), 1, 0), std::make_pair((ui32)-1, TDst::T_CREATE_BACK_CREF));
- UNIT_ASSERT_VALUES_EQUAL(DoTestParseDstSuccess(TStringBuf("\x05"sv), 1, 0), std::make_pair((ui32)-1, TDst::T_CREATE_BACK_RREF));
- UNIT_ASSERT_VALUES_EQUAL(DoTestParseDstSuccess(TStringBuf("\x26\x00"sv), 2, 0), std::make_pair(1u, TDst::T_LREF__POS));
- UNIT_ASSERT_VALUES_EQUAL(DoTestParseDstSuccess(TStringBuf("\x27\x00"sv), 2, 0), std::make_pair(1u, TDst::T_CREF__POS));
- UNIT_ASSERT_VALUES_EQUAL(DoTestParseDstSuccess(TStringBuf("\x28\x00"sv), 2, 0), std::make_pair(1u, TDst::T_RREF__POS));
+ UNIT_ASSERT_VALUES_EQUAL(DoTestParseDstSuccess(TStringBuf("\x00"sv), 1, 0), std::make_pair((ui32)-1, TDst::T_CREATE_FRONT_LREF));
+ UNIT_ASSERT_VALUES_EQUAL(DoTestParseDstSuccess(TStringBuf("\x01"sv), 1, 0), std::make_pair((ui32)-1, TDst::T_CREATE_FRONT_CREF));
+ UNIT_ASSERT_VALUES_EQUAL(DoTestParseDstSuccess(TStringBuf("\x02"sv), 1, 0), std::make_pair((ui32)-1, TDst::T_CREATE_FRONT_RREF));
+ UNIT_ASSERT_VALUES_EQUAL(DoTestParseDstSuccess(TStringBuf("\x03"sv), 1, 0), std::make_pair((ui32)-1, TDst::T_CREATE_BACK_LREF));
+ UNIT_ASSERT_VALUES_EQUAL(DoTestParseDstSuccess(TStringBuf("\x04"sv), 1, 0), std::make_pair((ui32)-1, TDst::T_CREATE_BACK_CREF));
+ UNIT_ASSERT_VALUES_EQUAL(DoTestParseDstSuccess(TStringBuf("\x05"sv), 1, 0), std::make_pair((ui32)-1, TDst::T_CREATE_BACK_RREF));
+ UNIT_ASSERT_VALUES_EQUAL(DoTestParseDstSuccess(TStringBuf("\x26\x00"sv), 2, 0), std::make_pair(1u, TDst::T_LREF__POS));
+ UNIT_ASSERT_VALUES_EQUAL(DoTestParseDstSuccess(TStringBuf("\x27\x00"sv), 2, 0), std::make_pair(1u, TDst::T_CREF__POS));
+ UNIT_ASSERT_VALUES_EQUAL(DoTestParseDstSuccess(TStringBuf("\x28\x00"sv), 2, 0), std::make_pair(1u, TDst::T_RREF__POS));
- DoTestParseDstFailure(TStringBuf("\x06"sv), 1, 0);
- DoTestParseDstFailure(TStringBuf("\x09\x00"sv), 1, 0);
+ DoTestParseDstFailure(TStringBuf("\x06"sv), 1, 0);
+ DoTestParseDstFailure(TStringBuf("\x09\x00"sv), 1, 0);
{
- TVMState st{TStringBuf("\x14\xE7\x09"sv), 16, 0};
+ TVMState st{TStringBuf("\x14\xE7\x09"sv), 16, 0};
// 4=4
UNIT_ASSERT_VALUES_EQUAL(DoTestParseDstSuccess(st), std::make_pair((ui32)-1, TDst::T_CREATE_BACK_CREF));
// 4=8
@@ -217,8 +217,8 @@ Y_UNIT_TEST_SUITE(TestParseNextAction) {
Y_UNIT_TEST(TestParsePath) {
DoTestParsePathFailure("", 1, 0);
- UNIT_ASSERT_VALUES_EQUAL(DoTestParsePathSuccess(TStringBuf("\x00"sv), 1, 0), TStringBuf(""));
- UNIT_ASSERT_VALUES_EQUAL(DoTestParsePathSuccess(TStringBuf("\x21\x0C"sv), 1, 0), TStringBuf("a"));
+ UNIT_ASSERT_VALUES_EQUAL(DoTestParsePathSuccess(TStringBuf("\x00"sv), 1, 0), TStringBuf(""));
+ UNIT_ASSERT_VALUES_EQUAL(DoTestParsePathSuccess(TStringBuf("\x21\x0C"sv), 1, 0), TStringBuf("a"));
DoTestParsePathFailure("\x22\x0C", 1, 0);
}
diff --git a/library/cpp/scheme/tests/ut/scheme_cast_ut.cpp b/library/cpp/scheme/tests/ut/scheme_cast_ut.cpp
index 4f907157e9..84fa453ffc 100644
--- a/library/cpp/scheme/tests/ut/scheme_cast_ut.cpp
+++ b/library/cpp/scheme/tests/ut/scheme_cast_ut.cpp
@@ -14,7 +14,7 @@ using THI = THashMap<int, int>;
using TMI = TMap<int, int>;
using THSI = THashSet<int>;
using TSI = TSet<int>;
-using TPI = std::pair<int, int>;
+using TPI = std::pair<int, int>;
Y_UNIT_TEST_SUITE(TSchemeCastTest) {
Y_UNIT_TEST(TestYVector) {
diff --git a/library/cpp/scheme/tests/ut/scheme_json_ut.cpp b/library/cpp/scheme/tests/ut/scheme_json_ut.cpp
index daeb2654f9..429add3030 100644
--- a/library/cpp/scheme/tests/ut/scheme_json_ut.cpp
+++ b/library/cpp/scheme/tests/ut/scheme_json_ut.cpp
@@ -9,8 +9,8 @@
#include <type_traits>
#include <library/cpp/string_utils/quote/quote.h>
-using namespace std::string_view_literals;
-
+using namespace std::string_view_literals;
+
Y_UNIT_TEST_SUITE(TSchemeJsonTest) {
Y_UNIT_TEST(TestJson) {
const char* json = "[\n"
@@ -122,7 +122,7 @@ Y_UNIT_TEST_SUITE(TSchemeJsonTest) {
}
Y_UNIT_TEST(TestJsonEscape) {
- NSc::TValue v("\10\7\6\5\4\3\2\1\0"sv);
+ NSc::TValue v("\10\7\6\5\4\3\2\1\0"sv);
UNIT_ASSERT_VALUES_EQUAL(v.ToJson(), "\"\\b\\u0007\\u0006\\u0005\\u0004\\u0003\\u0002\\u0001\\u0000\"");
}
diff --git a/library/cpp/scheme/tests/ut/scheme_merge_ut.cpp b/library/cpp/scheme/tests/ut/scheme_merge_ut.cpp
index 2a06cf110d..d7e2f75818 100644
--- a/library/cpp/scheme/tests/ut/scheme_merge_ut.cpp
+++ b/library/cpp/scheme/tests/ut/scheme_merge_ut.cpp
@@ -42,8 +42,8 @@ Y_UNIT_TEST_SUITE(TSchemeMergeTest) {
UNIT_ASSERT(0. == v["a"][1]["f"]);
UNIT_ASSERT(v["a"][1]["g"].IsArray());
UNIT_ASSERT(v["a"][1]["g"].Has(1));
- UNIT_ASSERT(TStringBuf("h") == v["a"][1]["g"][0]);
- UNIT_ASSERT(TStringBuf("i") == v["a"][1]["g"][1]);
+ UNIT_ASSERT(TStringBuf("h") == v["a"][1]["g"][0]);
+ UNIT_ASSERT(TStringBuf("i") == v["a"][1]["g"][1]);
{
TStringBuf data = "{ a : [ { d : 42 }, { g : [ 3 ] } ], q : r }";
@@ -64,7 +64,7 @@ Y_UNIT_TEST_SUITE(TSchemeMergeTest) {
UNIT_ASSERT(v.Has("a"));
UNIT_ASSERT(v.Has("q"));
- UNIT_ASSERT(TStringBuf("r") == v["q"]);
+ UNIT_ASSERT(TStringBuf("r") == v["q"]);
UNIT_ASSERT(v["a"].Has(1));
UNIT_ASSERT(!v["a"][0].Has("b"));
UNIT_ASSERT(v["a"][0].Has("d"));