aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/cgiparam/cgiparam_ut.cpp
diff options
context:
space:
mode:
authoryazevnul <yazevnul@yandex-team.ru>2022-02-10 16:46:46 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:46 +0300
commit8cbc307de0221f84c80c42dcbe07d40727537e2c (patch)
tree625d5a673015d1df891e051033e9fcde5c7be4e5 /library/cpp/cgiparam/cgiparam_ut.cpp
parent30d1ef3941e0dc835be7609de5ebee66958f215a (diff)
downloadydb-8cbc307de0221f84c80c42dcbe07d40727537e2c.tar.gz
Restoring authorship annotation for <yazevnul@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/cgiparam/cgiparam_ut.cpp')
-rw-r--r--library/cpp/cgiparam/cgiparam_ut.cpp42
1 files changed, 21 insertions, 21 deletions
diff --git a/library/cpp/cgiparam/cgiparam_ut.cpp b/library/cpp/cgiparam/cgiparam_ut.cpp
index a562342084..c9946462f9 100644
--- a/library/cpp/cgiparam/cgiparam_ut.cpp
+++ b/library/cpp/cgiparam/cgiparam_ut.cpp
@@ -2,8 +2,8 @@
#include <library/cpp/testing/unittest/registar.h>
-Y_UNIT_TEST_SUITE(TCgiParametersTest) {
- Y_UNIT_TEST(TestScan1) {
+Y_UNIT_TEST_SUITE(TCgiParametersTest) {
+ Y_UNIT_TEST(TestScan1) {
TCgiParameters C;
C.Scan("aaa=b%62b&ccc=ddd&ag0=");
UNIT_ASSERT_EQUAL(C.Get("aaa") == "bbb", true);
@@ -38,7 +38,7 @@ Y_UNIT_TEST_SUITE(TCgiParametersTest) {
UNIT_ASSERT(!C.Has("aaa"));
}
- Y_UNIT_TEST(TestScan2) {
+ Y_UNIT_TEST(TestScan2) {
const TString parsee("=000&aaa=bbb&ag0=&ccc=ddd");
TCgiParameters c;
c.Scan(parsee);
@@ -46,7 +46,7 @@ Y_UNIT_TEST_SUITE(TCgiParametersTest) {
UNIT_ASSERT_VALUES_EQUAL(c.Print(), parsee);
}
- Y_UNIT_TEST(TestScan3) {
+ Y_UNIT_TEST(TestScan3) {
const TString parsee("aaa=bbb&ag0=&ccc=ddd");
TCgiParameters c;
c.Scan(parsee);
@@ -56,7 +56,7 @@ Y_UNIT_TEST_SUITE(TCgiParametersTest) {
UNIT_ASSERT_VALUES_EQUAL(c.Print(), parsee + "&d=xxx");
}
- Y_UNIT_TEST(TestScanAddAll1) {
+ Y_UNIT_TEST(TestScanAddAll1) {
TCgiParameters c;
c.ScanAddAll("qw");
@@ -64,7 +64,7 @@ Y_UNIT_TEST_SUITE(TCgiParametersTest) {
UNIT_ASSERT(c.Get("qw").empty());
}
- Y_UNIT_TEST(TestScanAddAll2) {
+ Y_UNIT_TEST(TestScanAddAll2) {
TCgiParameters c;
c.ScanAddAll("qw&");
@@ -72,7 +72,7 @@ Y_UNIT_TEST_SUITE(TCgiParametersTest) {
UNIT_ASSERT(c.Get("qw").empty());
}
- Y_UNIT_TEST(TestScanAddAll3) {
+ Y_UNIT_TEST(TestScanAddAll3) {
TCgiParameters c;
c.ScanAddAll("qw=1&x");
@@ -81,7 +81,7 @@ Y_UNIT_TEST_SUITE(TCgiParametersTest) {
UNIT_ASSERT(c.Get("x").empty());
}
- Y_UNIT_TEST(TestScanAddAll4) {
+ Y_UNIT_TEST(TestScanAddAll4) {
TCgiParameters c;
c.ScanAddAll("ccc=1&aaa=1&ccc=3&bbb&ccc=2");
@@ -111,7 +111,7 @@ Y_UNIT_TEST_SUITE(TCgiParametersTest) {
UNIT_ASSERT_VALUES_EQUAL(c.Get("text"), "%D0%9F%D1%80%D0%B8%D0%B2%D0%B5%D1%82%2C");
}
- Y_UNIT_TEST(TestEraseAll) {
+ Y_UNIT_TEST(TestEraseAll) {
TCgiParameters c;
c.ScanAddAll("par=1&aaa=1&par=2&bbb&par=3");
c.EraseAll("par");
@@ -119,7 +119,7 @@ Y_UNIT_TEST_SUITE(TCgiParametersTest) {
UNIT_ASSERT_VALUES_EQUAL(c.Print(), "aaa=1&bbb=");
}
- Y_UNIT_TEST(TestErase) {
+ Y_UNIT_TEST(TestErase) {
TCgiParameters c;
c.ScanAddAll("par=1&aaa=1&par=2&bbb&par=3&par=1");
@@ -130,7 +130,7 @@ Y_UNIT_TEST_SUITE(TCgiParametersTest) {
UNIT_ASSERT_VALUES_EQUAL(c.Print(), "aaa=1&bbb=&par=3");
}
- Y_UNIT_TEST(TestReplaceUnescaped1) {
+ Y_UNIT_TEST(TestReplaceUnescaped1) {
TCgiParameters c;
c.ScanAddAll("many_keys=1&aaa=1&many_keys=2&bbb&many_keys=3");
c.ReplaceUnescaped("many_keys", "new_value");
@@ -138,7 +138,7 @@ Y_UNIT_TEST_SUITE(TCgiParametersTest) {
UNIT_ASSERT_VALUES_EQUAL(c.Print(), "aaa=1&bbb=&many_keys=new_value");
}
- Y_UNIT_TEST(TestReplaceUnescaped2) {
+ Y_UNIT_TEST(TestReplaceUnescaped2) {
TCgiParameters c;
c.ScanAddAll("par=1&only_one=1&par=2&bbb&par=3");
c.ReplaceUnescaped("only_one", "new_value");
@@ -146,7 +146,7 @@ Y_UNIT_TEST_SUITE(TCgiParametersTest) {
UNIT_ASSERT_VALUES_EQUAL(c.Print(), "bbb=&only_one=new_value&par=1&par=2&par=3");
}
- Y_UNIT_TEST(TestReplaceUnescaped3) {
+ Y_UNIT_TEST(TestReplaceUnescaped3) {
TCgiParameters c;
c.ScanAddAll("par=1&aaa=1&par=2&bbb&par=3");
c.ReplaceUnescaped("no_such_key", "new_value");
@@ -154,7 +154,7 @@ Y_UNIT_TEST_SUITE(TCgiParametersTest) {
UNIT_ASSERT_VALUES_EQUAL(c.Print(), "aaa=1&bbb=&no_such_key=new_value&par=1&par=2&par=3");
}
- Y_UNIT_TEST(TestReplaceUnescapedRange1) {
+ Y_UNIT_TEST(TestReplaceUnescapedRange1) {
TCgiParameters c;
c.ScanAddAll("par=1&aaa=1&par=2&bbb&par=3");
c.ReplaceUnescaped("par", {"x", "y", "z"}); // 3 old values, 3 new values
@@ -162,7 +162,7 @@ Y_UNIT_TEST_SUITE(TCgiParametersTest) {
UNIT_ASSERT_VALUES_EQUAL(c.Print(), "aaa=1&bbb=&par=x&par=y&par=z");
}
- Y_UNIT_TEST(TestReplaceUnescapedRange2) {
+ Y_UNIT_TEST(TestReplaceUnescapedRange2) {
TCgiParameters c;
c.ScanAddAll("par=1&aaa=1&par=2&bbb");
c.ReplaceUnescaped("par", {"x", "y", "z"}); // 2 old values, 3 new values
@@ -170,7 +170,7 @@ Y_UNIT_TEST_SUITE(TCgiParametersTest) {
UNIT_ASSERT_VALUES_EQUAL(c.Print(), "aaa=1&bbb=&par=x&par=y&par=z");
}
- Y_UNIT_TEST(TestReplaceUnescapedRange3) {
+ Y_UNIT_TEST(TestReplaceUnescapedRange3) {
TCgiParameters c;
c.ScanAddAll("par=1&aaa=1&par=2&bbb&par=3");
c.ReplaceUnescaped("par", {"x", "y"}); // 3 old values, 2 new values
@@ -178,23 +178,23 @@ Y_UNIT_TEST_SUITE(TCgiParametersTest) {
UNIT_ASSERT_VALUES_EQUAL(c.Print(), "aaa=1&bbb=&par=x&par=y");
}
- Y_UNIT_TEST(TestNumOfValues) {
+ Y_UNIT_TEST(TestNumOfValues) {
TCgiParameters c;
c.ScanAddAll("par=1&aaa=1&par=2&bbb&par=3");
UNIT_ASSERT_VALUES_EQUAL(c.NumOfValues("par"), 3u);
}
- Y_UNIT_TEST(TestUnscape) {
+ Y_UNIT_TEST(TestUnscape) {
TCgiParameters c("f=1&t=%84R%84%7C%84%80%84%7E&reqenc=SHIFT_JIS&p=0");
UNIT_ASSERT_VALUES_EQUAL(c.Get("t"), "\x84R\x84\x7C\x84\x80\x84\x7E");
}
- Y_UNIT_TEST(TestEmpty) {
+ Y_UNIT_TEST(TestEmpty) {
UNIT_ASSERT(TCgiParameters().Print().empty());
}
- Y_UNIT_TEST(TestJoinUnescaped) {
+ Y_UNIT_TEST(TestJoinUnescaped) {
TCgiParameters c;
c.Scan("foo=1&foo=2");
@@ -203,7 +203,7 @@ Y_UNIT_TEST_SUITE(TCgiParametersTest) {
UNIT_ASSERT_VALUES_EQUAL(c.Print(), "foo=1;2;0");
}
- Y_UNIT_TEST(TestContInit) {
+ Y_UNIT_TEST(TestContInit) {
TCgiParameters c = {std::make_pair("a", "a1"), std::make_pair("b", "b1"), std::make_pair("a", "a2")};
UNIT_ASSERT_VALUES_EQUAL(c.NumOfValues("a"), 2u);