diff options
author | spacelord <spacelord@yandex-team.ru> | 2022-02-10 16:48:15 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:48:15 +0300 |
commit | 16747e4f77455cca4932df21eb76f12cb0a97a5c (patch) | |
tree | 4dd6da4102d99d0d69dec53c1050d290a850a9f2 /util/string/builder_ut.cpp | |
parent | a817f5de12611ec73085eba17f8ec7740a46bdb7 (diff) | |
download | ydb-16747e4f77455cca4932df21eb76f12cb0a97a5c.tar.gz |
Restoring authorship annotation for <spacelord@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'util/string/builder_ut.cpp')
-rw-r--r-- | util/string/builder_ut.cpp | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/util/string/builder_ut.cpp b/util/string/builder_ut.cpp index 22def683ec..59270ba2e0 100644 --- a/util/string/builder_ut.cpp +++ b/util/string/builder_ut.cpp @@ -1,42 +1,42 @@ -#include "builder.h" - +#include "builder.h" + #include <library/cpp/testing/unittest/registar.h> - + static void TestEquals(const TString& expected, const TString& actual) { - UNIT_ASSERT_VALUES_EQUAL(expected, actual); -} - -struct TClassWithStreamOperator { - ui32 Id; + UNIT_ASSERT_VALUES_EQUAL(expected, actual); +} + +struct TClassWithStreamOperator { + ui32 Id; TString Name; - + TClassWithStreamOperator(ui32 id, const TString& name) - : Id(id) - , Name(name) - { - } -}; - + : Id(id) + , Name(name) + { + } +}; + IOutputStream& operator<<(IOutputStream& out, const TClassWithStreamOperator& value) { - return out << value.Id << " " << value.Name; -} - + return out << value.Id << " " << value.Name; +} + Y_UNIT_TEST_SUITE(TStringBuilderTest) { Y_UNIT_TEST(TestStringBuilder) { - TestEquals("", TStringBuilder()); - TestEquals("a", TStringBuilder() << "a"); - TestEquals("a1", TStringBuilder() << "a" << 1); - TestEquals("value: 123 name", TStringBuilder() << "value: " << TClassWithStreamOperator(123, "name")); - } - + TestEquals("", TStringBuilder()); + TestEquals("a", TStringBuilder() << "a"); + TestEquals("a1", TStringBuilder() << "a" << 1); + TestEquals("value: 123 name", TStringBuilder() << "value: " << TClassWithStreamOperator(123, "name")); + } + Y_UNIT_TEST(TestStringBuilderOut) { TString s; - TStringOutput out(s); - TStringBuilder sb; - sb << "a"; - out << sb; - TestEquals("a", s); - } + TStringOutput out(s); + TStringBuilder sb; + sb << "a"; + out << sb; + TestEquals("a", s); + } Y_UNIT_TEST(TestStringBuilderRValue) { struct TRValueAcceptTester { @@ -60,4 +60,4 @@ Y_UNIT_TEST_SUITE(TStringBuilderTest) { UNIT_ASSERT(TRValueAcceptTester::IsRValue(TStringBuilder() << b2)); UNIT_ASSERT_VALUES_EQUAL("a1a", TStringBuilder() << b2); } -} +} |