aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/yson_pull/ut/cescape_ut.cpp
diff options
context:
space:
mode:
authorMikhail Borisov <borisov.mikhail@gmail.com>2022-02-10 16:45:40 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:45:40 +0300
commit5d50718e66d9c037dc587a0211110b7d25a66185 (patch)
treee98df59de24d2ef7c77baed9f41e4875a2fef972 /library/cpp/yson_pull/ut/cescape_ut.cpp
parenta6a92afe03e02795227d2641b49819b687f088f8 (diff)
downloadydb-5d50718e66d9c037dc587a0211110b7d25a66185.tar.gz
Restoring authorship annotation for Mikhail Borisov <borisov.mikhail@gmail.com>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/yson_pull/ut/cescape_ut.cpp')
-rw-r--r--library/cpp/yson_pull/ut/cescape_ut.cpp34
1 files changed, 17 insertions, 17 deletions
diff --git a/library/cpp/yson_pull/ut/cescape_ut.cpp b/library/cpp/yson_pull/ut/cescape_ut.cpp
index 50b0f6ff09..6628ba1d15 100644
--- a/library/cpp/yson_pull/ut/cescape_ut.cpp
+++ b/library/cpp/yson_pull/ut/cescape_ut.cpp
@@ -1,10 +1,10 @@
#include <library/cpp/yson_pull/detail/cescape.h>
-
+
#include <library/cpp/testing/unittest/registar.h>
-
-using namespace NYsonPull::NDetail;
-
-namespace {
+
+using namespace NYsonPull::NDetail;
+
+namespace {
void test_roundtrip(const TVector<ui8>& str) {
TStringBuf str_buf(
reinterpret_cast<const char*>(str.data()),
@@ -17,7 +17,7 @@ namespace {
<< "B[" << tmp.size() << "]: " << tmp << '\n'
<< "C[" << dest.size() << "]: " << dest);
}
-
+
template <size_t N>
void test_exhaustive(TVector<ui8>& str) {
for (int i = 0; i < 256; ++i) {
@@ -25,33 +25,33 @@ namespace {
test_exhaustive<N - 1>(str);
}
}
-
+
template <>
void test_exhaustive<0>(TVector<ui8>& str) {
test_roundtrip(str);
- }
-
+ }
+
template <size_t N>
void test_exhaustive() {
TVector<ui8> str(N, ' ');
test_exhaustive<N>(str);
}
-
-} // anonymous namespace
-
+
+} // anonymous namespace
+
Y_UNIT_TEST_SUITE(CEscape) {
Y_UNIT_TEST(ExhaustiveOneChar) {
test_exhaustive<1>();
}
-
+
Y_UNIT_TEST(ExhaustiveTwoChars) {
test_exhaustive<2>();
}
-
+
Y_UNIT_TEST(ExhaustiveThreeChars) {
test_exhaustive<3>();
}
-
+
Y_UNIT_TEST(SpecialEscapeEncode) {
//UNIT_ASSERT_VALUES_EQUAL(R"(\b)", NCEscape::encode("\b"));
//UNIT_ASSERT_VALUES_EQUAL(R"(\f)", NCEscape::encode("\f"));
@@ -59,7 +59,7 @@ Y_UNIT_TEST_SUITE(CEscape) {
UNIT_ASSERT_VALUES_EQUAL(R"(\r)", NCEscape::encode("\r"));
UNIT_ASSERT_VALUES_EQUAL(R"(\t)", NCEscape::encode("\t"));
}
-
+
Y_UNIT_TEST(SpecialEscapeDecode) {
UNIT_ASSERT_VALUES_EQUAL("\b", NCEscape::decode(R"(\b)"));
UNIT_ASSERT_VALUES_EQUAL("\f", NCEscape::decode(R"(\f)"));
@@ -67,5 +67,5 @@ Y_UNIT_TEST_SUITE(CEscape) {
UNIT_ASSERT_VALUES_EQUAL("\r", NCEscape::decode(R"(\r)"));
UNIT_ASSERT_VALUES_EQUAL("\t", NCEscape::decode(R"(\t)"));
}
-
+
} // Y_UNIT_TEST_SUITE(CEscape)