diff options
author | babenko <babenko@yandex-team.ru> | 2022-02-10 16:49:19 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:49:19 +0300 |
commit | cec37806d8847aa3db53bafc9e251d4aaf325c12 (patch) | |
tree | 4a61c191e93e31d9ab423e258c71ab43550ee3d2 /library/cpp/yt/string/unittests/string_ut.cpp | |
parent | 58cd0b86ed99a72df22479e26a20bc1c1e57e65e (diff) | |
download | ydb-cec37806d8847aa3db53bafc9e251d4aaf325c12.tar.gz |
Restoring authorship annotation for <babenko@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/yt/string/unittests/string_ut.cpp')
-rw-r--r-- | library/cpp/yt/string/unittests/string_ut.cpp | 102 |
1 files changed, 51 insertions, 51 deletions
diff --git a/library/cpp/yt/string/unittests/string_ut.cpp b/library/cpp/yt/string/unittests/string_ut.cpp index 3e12312af0..758c804b8a 100644 --- a/library/cpp/yt/string/unittests/string_ut.cpp +++ b/library/cpp/yt/string/unittests/string_ut.cpp @@ -1,52 +1,52 @@ #include <library/cpp/testing/gtest/gtest.h> - -#include <library/cpp/yt/string/string.h> - -namespace NYT { -namespace { - -//////////////////////////////////////////////////////////////////////////////// - -struct TTestCase -{ - const char* UnderCase; - const char* CamelCase; -}; - -static std::vector<TTestCase> TestCases { - { "kenny", "Kenny" }, - { "south_park", "SouthPark" }, - { "a", "A" }, - { "a_b_c", "ABC" }, - { "reed_solomon_6_3", "ReedSolomon_6_3" }, - { "lrc_12_2_2", "Lrc_12_2_2" }, - { "0", "0" }, - { "0_1_2", "0_1_2" }, - { "int64", "Int64" } -}; - -//////////////////////////////////////////////////////////////////////////////// - -TEST(TStringTest, UnderscoreCaseToCamelCase) -{ - for (const auto& testCase : TestCases) { - auto result = UnderscoreCaseToCamelCase(testCase.UnderCase); - EXPECT_STREQ(testCase.CamelCase, result.c_str()) - << "Original: \"" << testCase.UnderCase << '"'; - } -} - -TEST(TStringTest, CamelCaseToUnderscoreCase) -{ - for (const auto& testCase : TestCases) { - auto result = CamelCaseToUnderscoreCase(testCase.CamelCase); - EXPECT_STREQ(testCase.UnderCase, result.c_str()) - << "Original: \"" << testCase.CamelCase << '"'; - } -} - -//////////////////////////////////////////////////////////////////////////////// - -} // namespace -} // namespace NYT - + +#include <library/cpp/yt/string/string.h> + +namespace NYT { +namespace { + +//////////////////////////////////////////////////////////////////////////////// + +struct TTestCase +{ + const char* UnderCase; + const char* CamelCase; +}; + +static std::vector<TTestCase> TestCases { + { "kenny", "Kenny" }, + { "south_park", "SouthPark" }, + { "a", "A" }, + { "a_b_c", "ABC" }, + { "reed_solomon_6_3", "ReedSolomon_6_3" }, + { "lrc_12_2_2", "Lrc_12_2_2" }, + { "0", "0" }, + { "0_1_2", "0_1_2" }, + { "int64", "Int64" } +}; + +//////////////////////////////////////////////////////////////////////////////// + +TEST(TStringTest, UnderscoreCaseToCamelCase) +{ + for (const auto& testCase : TestCases) { + auto result = UnderscoreCaseToCamelCase(testCase.UnderCase); + EXPECT_STREQ(testCase.CamelCase, result.c_str()) + << "Original: \"" << testCase.UnderCase << '"'; + } +} + +TEST(TStringTest, CamelCaseToUnderscoreCase) +{ + for (const auto& testCase : TestCases) { + auto result = CamelCaseToUnderscoreCase(testCase.CamelCase); + EXPECT_STREQ(testCase.UnderCase, result.c_str()) + << "Original: \"" << testCase.CamelCase << '"'; + } +} + +//////////////////////////////////////////////////////////////////////////////// + +} // namespace +} // namespace NYT + |