aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/string_utils/quote/quote_ut.cpp
diff options
context:
space:
mode:
authorijon <ijon@yandex-team.ru>2022-02-10 16:49:57 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:49:57 +0300
commitfcd93d3533aed781986b121b1362ca188bd96367 (patch)
tree5d5cb817648f650d76cf1076100726fd9b8448e8 /library/cpp/string_utils/quote/quote_ut.cpp
parenta62b5e9ea9837fdaa7a5e327b7f98b41e4d18cf6 (diff)
downloadydb-fcd93d3533aed781986b121b1362ca188bd96367.tar.gz
Restoring authorship annotation for <ijon@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/string_utils/quote/quote_ut.cpp')
-rw-r--r--library/cpp/string_utils/quote/quote_ut.cpp54
1 files changed, 27 insertions, 27 deletions
diff --git a/library/cpp/string_utils/quote/quote_ut.cpp b/library/cpp/string_utils/quote/quote_ut.cpp
index 048e6b18a1..6c552b279e 100644
--- a/library/cpp/string_utils/quote/quote_ut.cpp
+++ b/library/cpp/string_utils/quote/quote_ut.cpp
@@ -4,11 +4,11 @@
Y_UNIT_TEST_SUITE(TCGIEscapeTest) {
Y_UNIT_TEST(ReturnsEndOfTo) {
- char r[10];
- const char* returned = CGIEscape(r, "123");
- UNIT_ASSERT_VALUES_EQUAL(r + strlen("123"), returned);
- UNIT_ASSERT_VALUES_EQUAL('\0', *returned);
- }
+ char r[10];
+ const char* returned = CGIEscape(r, "123");
+ UNIT_ASSERT_VALUES_EQUAL(r + strlen("123"), returned);
+ UNIT_ASSERT_VALUES_EQUAL('\0', *returned);
+ }
Y_UNIT_TEST(NotZeroTerminated) {
char r[] = {'1', '2', '3', '4'};
@@ -45,8 +45,8 @@ Y_UNIT_TEST_SUITE(TCGIEscapeTest) {
TString("&param=!@%23$%25^%26*%28%29%7B%7D%5B%5D%22+&param_param=!@%23$%25^%26*%28%29%7B%7D%5B%5D%22+"));
}
-}
-
+}
+
Y_UNIT_TEST_SUITE(TCGIUnescapeTest) {
Y_UNIT_TEST(StringBuf) {
char tmp[100];
@@ -287,33 +287,33 @@ Y_UNIT_TEST_SUITE(TUrlUnescapeTest) {
Y_UNIT_TEST_SUITE(TQuoteTest) {
Y_UNIT_TEST(ReturnsEndOfTo) {
- char r[10];
- const char* returned = Quote(r, "123");
- UNIT_ASSERT_VALUES_EQUAL(r + strlen("123"), returned);
- UNIT_ASSERT_VALUES_EQUAL('\0', *returned);
- }
-
+ char r[10];
+ const char* returned = Quote(r, "123");
+ UNIT_ASSERT_VALUES_EQUAL(r + strlen("123"), returned);
+ UNIT_ASSERT_VALUES_EQUAL('\0', *returned);
+ }
+
Y_UNIT_TEST(SlashIsSafeByDefault) {
- char r[100];
- Quote(r, "/path;tail/path,tail/");
- UNIT_ASSERT_VALUES_EQUAL("/path%3Btail/path%2Ctail/", r);
+ char r[100];
+ Quote(r, "/path;tail/path,tail/");
+ UNIT_ASSERT_VALUES_EQUAL("/path%3Btail/path%2Ctail/", r);
TString s("/path;tail/path,tail/");
- Quote(s);
- UNIT_ASSERT_VALUES_EQUAL("/path%3Btail/path%2Ctail/", s.c_str());
- }
-
+ Quote(s);
+ UNIT_ASSERT_VALUES_EQUAL("/path%3Btail/path%2Ctail/", s.c_str());
+ }
+
Y_UNIT_TEST(SafeColons) {
- char r[100];
- Quote(r, "/path;tail/path,tail/", ";,");
- UNIT_ASSERT_VALUES_EQUAL("%2Fpath;tail%2Fpath,tail%2F", r);
+ char r[100];
+ Quote(r, "/path;tail/path,tail/", ";,");
+ UNIT_ASSERT_VALUES_EQUAL("%2Fpath;tail%2Fpath,tail%2F", r);
TString s("/path;tail/path,tail/");
- Quote(s, ";,");
- UNIT_ASSERT_VALUES_EQUAL("%2Fpath;tail%2Fpath,tail%2F", s.c_str());
- }
+ Quote(s, ";,");
+ UNIT_ASSERT_VALUES_EQUAL("%2Fpath;tail%2Fpath,tail%2F", s.c_str());
+ }
Y_UNIT_TEST(StringBuf) {
char r[100];
char* end = Quote(r, "abc\0/path", "");
UNIT_ASSERT_VALUES_EQUAL("abc\0%2Fpath", TStringBuf(r, end));
}
-}
+}