aboutsummaryrefslogtreecommitdiffstats
path: root/util/string/escape_ut.cpp
diff options
context:
space:
mode:
authorpkalinnikov <pkalinnikov@yandex-team.ru>2022-02-10 16:50:15 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:50:15 +0300
commit9e33e026829d561d6fd46d72b88c367952e08075 (patch)
tree2af190fca83ac522e9a7e29de1daae32582064b4 /util/string/escape_ut.cpp
parentba5325cc01aabb81effc91ff1bdbb461313cbd00 (diff)
downloadydb-9e33e026829d561d6fd46d72b88c367952e08075.tar.gz
Restoring authorship annotation for <pkalinnikov@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'util/string/escape_ut.cpp')
-rw-r--r--util/string/escape_ut.cpp52
1 files changed, 26 insertions, 26 deletions
diff --git a/util/string/escape_ut.cpp b/util/string/escape_ut.cpp
index cd38ecffd3..c3e6e3a05b 100644
--- a/util/string/escape_ut.cpp
+++ b/util/string/escape_ut.cpp
@@ -103,33 +103,33 @@ Y_UNIT_TEST_SUITE(TEscapeCTest) {
// UNIT_ASSERT_VALUES_EQUAL("[x]?z", EscapeC(TString("??(x??)?z")));
UNIT_ASSERT_VALUES_EQUAL("\\x3F?x\\x3F\\x3F?z", EscapeC(TString("??x???z")));
}
-
+
Y_UNIT_TEST(TestUnescapeCCharLen) {
- auto test = [](const char* str, size_t len) {
- UNIT_ASSERT_EQUAL(UnescapeCCharLen(str, str + strlen(str)), len);
- };
-
- test("", 0);
- test("abc", 1);
- test("\\", 1);
- test("\\\\", 2);
- test("\\#", 2);
- test("\\n10", 2);
- test("\\r\\n", 2);
- test("\\x05abc", 4);
- test("\\u11117777", 6);
- test("\\u123yyy", 2);
- test("\\U11117777cccc", 10);
- test("\\U111yyy", 2);
- test("\\0\\1", 2);
- test("\\01\\1", 3);
- test("\\012\\1", 4);
- test("\\0123\\1", 4);
- test("\\4\\1", 2);
- test("\\40\\1", 3);
- test("\\400\\1", 3);
- test("\\4xxx", 2);
- }
+ auto test = [](const char* str, size_t len) {
+ UNIT_ASSERT_EQUAL(UnescapeCCharLen(str, str + strlen(str)), len);
+ };
+
+ test("", 0);
+ test("abc", 1);
+ test("\\", 1);
+ test("\\\\", 2);
+ test("\\#", 2);
+ test("\\n10", 2);
+ test("\\r\\n", 2);
+ test("\\x05abc", 4);
+ test("\\u11117777", 6);
+ test("\\u123yyy", 2);
+ test("\\U11117777cccc", 10);
+ test("\\U111yyy", 2);
+ test("\\0\\1", 2);
+ test("\\01\\1", 3);
+ test("\\012\\1", 4);
+ test("\\0123\\1", 4);
+ test("\\4\\1", 2);
+ test("\\40\\1", 3);
+ test("\\400\\1", 3);
+ test("\\4xxx", 2);
+ }
Y_UNIT_TEST(TestUnbounded) {
char buf[100000];