aboutsummaryrefslogtreecommitdiffstats
path: root/util/generic/is_in_ut.cpp
diff options
context:
space:
mode:
authorpozhilov <pozhilov@yandex-team.ru>2022-02-10 16:49:27 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:49:27 +0300
commit23bf1d16dddf213a6aa8e8d5c8621e1242a1f118 (patch)
treeed030ff443eb83431f11e53b6460b1b73d035412 /util/generic/is_in_ut.cpp
parent7156b3713e77ce36387436e5558320917698b7a2 (diff)
downloadydb-23bf1d16dddf213a6aa8e8d5c8621e1242a1f118.tar.gz
Restoring authorship annotation for <pozhilov@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'util/generic/is_in_ut.cpp')
-rw-r--r--util/generic/is_in_ut.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/util/generic/is_in_ut.cpp b/util/generic/is_in_ut.cpp
index c668bce807..1306e427e7 100644
--- a/util/generic/is_in_ut.cpp
+++ b/util/generic/is_in_ut.cpp
@@ -70,7 +70,7 @@ Y_UNIT_TEST_SUITE(TIsIn) {
UNIT_ASSERT(IsIn(b, 'f'));
UNIT_ASSERT(!IsIn(b, 'z'));
}
-
+
Y_UNIT_TEST(IsInInitListTest) {
const char* abc = "abc";
const char* def = "def";
@@ -88,22 +88,22 @@ Y_UNIT_TEST_SUITE(TIsIn) {
UNIT_ASSERT(!IsIn({TStringBuf("abc"), TStringBuf("def")}, TStringBuf("ghi")));
UNIT_ASSERT(!IsIn({"abc", "def"}, TStringBuf("ghi")));
UNIT_ASSERT(!IsIn({"abc", "def"}, TString("ghi")));
-
- const TStringBuf str = "abc////";
-
+
+ const TStringBuf str = "abc////";
+
UNIT_ASSERT(IsIn({"abc", "def"}, TStringBuf{str.data(), 3}));
}
Y_UNIT_TEST(ConfOfTest) {
UNIT_ASSERT(IsIn({1, 2, 3}, 1));
UNIT_ASSERT(!IsIn({1, 2, 3}, 4));
-
+
const TString b = "b";
-
+
UNIT_ASSERT(!IsIn({"a", "b", "c"}, b.data())); // compares pointers by value. Whether it's good or not.
UNIT_ASSERT(IsIn(TVector<TStringBuf>({"a", "b", "c"}), b.data()));
UNIT_ASSERT(IsIn(TVector<TStringBuf>({"a", "b", "c"}), "b"));
- }
+ }
Y_UNIT_TEST(IsInArrayTest) {
const TString array[] = {"a", "b", "d"};