From a62b5e9ea9837fdaa7a5e327b7f98b41e4d18cf6 Mon Sep 17 00:00:00 2001 From: ijon <ijon@yandex-team.ru> Date: Thu, 10 Feb 2022 16:49:56 +0300 Subject: Restoring authorship annotation for <ijon@yandex-team.ru>. Commit 1 of 2. --- library/cpp/string_utils/quote/quote_ut.cpp | 54 ++++++++++++++--------------- 1 file changed, 27 insertions(+), 27 deletions(-) (limited to 'library/cpp/string_utils/quote/quote_ut.cpp') diff --git a/library/cpp/string_utils/quote/quote_ut.cpp b/library/cpp/string_utils/quote/quote_ut.cpp index 6c552b279e..048e6b18a1 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("¶m=!@%23$%25^%26*%28%29%7B%7D%5B%5D%22+¶m_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)); } -} +} -- cgit v1.2.3