diff options
author | Vlad Yaroslavlev <vladon@vladon.com> | 2022-02-10 16:46:25 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:25 +0300 |
commit | 344ea37b4a345701ab0e67de2266a1c1bd7baf2d (patch) | |
tree | 1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /util/generic/is_in_ut.cpp | |
parent | 706b83ed7de5a473436620367af31fc0ceecde07 (diff) | |
download | ydb-344ea37b4a345701ab0e67de2266a1c1bd7baf2d.tar.gz |
Restoring authorship annotation for Vlad Yaroslavlev <vladon@vladon.com>. Commit 2 of 2.
Diffstat (limited to 'util/generic/is_in_ut.cpp')
-rw-r--r-- | util/generic/is_in_ut.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/util/generic/is_in_ut.cpp b/util/generic/is_in_ut.cpp index b98b37aa70e..c668bce8078 100644 --- a/util/generic/is_in_ut.cpp +++ b/util/generic/is_in_ut.cpp @@ -7,7 +7,7 @@ #include "map.h" #include "set.h" #include "strbuf.h" -#include "string.h" +#include "string.h" Y_UNIT_TEST_SUITE(TIsIn) { template <class TCont, class T> @@ -41,18 +41,18 @@ Y_UNIT_TEST_SUITE(TIsIn) { } Y_UNIT_TEST(IsInTest) { - TestIsInWithCont<TMap<TString, TString>>(std::make_pair("found", "1")); - TestIsInWithCont<TMultiMap<TString, TString>>(std::make_pair("found", "1")); - TestIsInWithCont<THashMap<TString, TString>>(std::make_pair("found", "1")); - TestIsInWithCont<THashMultiMap<TString, TString>>(std::make_pair("found", "1")); + TestIsInWithCont<TMap<TString, TString>>(std::make_pair("found", "1")); + TestIsInWithCont<TMultiMap<TString, TString>>(std::make_pair("found", "1")); + TestIsInWithCont<THashMap<TString, TString>>(std::make_pair("found", "1")); + TestIsInWithCont<THashMultiMap<TString, TString>>(std::make_pair("found", "1")); - TestIsInWithCont<TSet<TString>>("found"); - TestIsInWithCont<TMultiSet<TString>>("found"); - TestIsInWithCont<THashSet<TString>>("found"); - TestIsInWithCont<THashMultiSet<TString>>("found"); + TestIsInWithCont<TSet<TString>>("found"); + TestIsInWithCont<TMultiSet<TString>>("found"); + TestIsInWithCont<THashSet<TString>>("found"); + TestIsInWithCont<THashMultiSet<TString>>("found"); // vector also compiles and works - TVector<TString> v; + TVector<TString> v; v.push_back("found"); UNIT_ASSERT(IsIn(v, "found")); UNIT_ASSERT(!IsIn(v, "not found")); @@ -61,8 +61,8 @@ Y_UNIT_TEST_SUITE(TIsIn) { UNIT_ASSERT(IsIn(v.begin(), v.end(), "found")); UNIT_ASSERT(!IsIn(v.begin(), v.end(), "not found")); - // Works with TString (it has find, but find is not used) - TString s = "found"; + // Works with TString (it has find, but find is not used) + TString s = "found"; UNIT_ASSERT(IsIn(s, 'f')); UNIT_ASSERT(!IsIn(s, 'z')); @@ -87,7 +87,7 @@ Y_UNIT_TEST_SUITE(TIsIn) { UNIT_ASSERT(IsIn({abc, def}, def)); // direct pointer comparison UNIT_ASSERT(!IsIn({TStringBuf("abc"), TStringBuf("def")}, TStringBuf("ghi"))); UNIT_ASSERT(!IsIn({"abc", "def"}, TStringBuf("ghi"))); - UNIT_ASSERT(!IsIn({"abc", "def"}, TString("ghi"))); + UNIT_ASSERT(!IsIn({"abc", "def"}, TString("ghi"))); const TStringBuf str = "abc////"; @@ -98,11 +98,11 @@ Y_UNIT_TEST_SUITE(TIsIn) { UNIT_ASSERT(IsIn({1, 2, 3}, 1)); UNIT_ASSERT(!IsIn({1, 2, 3}, 4)); - const TString b = "b"; + 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")); + UNIT_ASSERT(IsIn(TVector<TStringBuf>({"a", "b", "c"}), "b")); } Y_UNIT_TEST(IsInArrayTest) { |