diff options
author | gritukan <gritukan@yandex-team.ru> | 2022-02-10 16:47:53 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:47:53 +0300 |
commit | 5ab2c1182d0b02a3880e1869c6351b7ba802a19b (patch) | |
tree | f1d99c4a9a7e3f3c2ed90004db7cd7dc8502c2ce /library/cpp/yt/string | |
parent | 2a4a975b112fa0fa138abc7457fe67e0e1e7fd02 (diff) | |
download | ydb-5ab2c1182d0b02a3880e1869c6351b7ba802a19b.tar.gz |
Restoring authorship annotation for <gritukan@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/yt/string')
-rw-r--r-- | library/cpp/yt/string/format-inl.h | 22 | ||||
-rw-r--r-- | library/cpp/yt/string/unittests/format_ut.cpp | 10 |
2 files changed, 16 insertions, 16 deletions
diff --git a/library/cpp/yt/string/format-inl.h b/library/cpp/yt/string/format-inl.h index 5484d4a216c..2d9e3184e2d 100644 --- a/library/cpp/yt/string/format-inl.h +++ b/library/cpp/yt/string/format-inl.h @@ -9,7 +9,7 @@ #include <library/cpp/yt/assert/assert.h> -#include <library/cpp/yt/small_containers/compact_vector.h> +#include <library/cpp/yt/small_containers/compact_vector.h> #include <library/cpp/yt/misc/enum.h> @@ -297,16 +297,16 @@ struct TValueFormatter<std::vector<T, TAllocator>> } }; -// TCompactVector -template <class T, unsigned N> -struct TValueFormatter<TCompactVector<T, N>> -{ - static void Do(TStringBuilderBase* builder, const TCompactVector<T, N>& collection, TStringBuf /*format*/) - { - FormatRange(builder, collection, TDefaultFormatter()); - } -}; - +// TCompactVector +template <class T, unsigned N> +struct TValueFormatter<TCompactVector<T, N>> +{ + static void Do(TStringBuilderBase* builder, const TCompactVector<T, N>& collection, TStringBuf /*format*/) + { + FormatRange(builder, collection, TDefaultFormatter()); + } +}; + // std::set template <class T> struct TValueFormatter<std::set<T>> diff --git a/library/cpp/yt/string/unittests/format_ut.cpp b/library/cpp/yt/string/unittests/format_ut.cpp index ee069bb2c09..499775857f7 100644 --- a/library/cpp/yt/string/unittests/format_ut.cpp +++ b/library/cpp/yt/string/unittests/format_ut.cpp @@ -2,7 +2,7 @@ #include <library/cpp/yt/string/format.h> -#include <library/cpp/yt/small_containers/compact_vector.h> +#include <library/cpp/yt/small_containers/compact_vector.h> #include <limits> @@ -71,7 +71,7 @@ TEST(TFormatTest, Strings) EXPECT_EQ("abc", Format("%-2s", TString("abc"))); EXPECT_EQ("abc", Format("%0s", TString("abc"))); EXPECT_EQ("abc", Format("%-0s", TString("abc"))); - EXPECT_EQ(100, std::ssize(Format("%100v", "abc"))); + EXPECT_EQ(100, std::ssize(Format("%100v", "abc"))); } TEST(TFormatTest, Integers) @@ -79,9 +79,9 @@ TEST(TFormatTest, Integers) EXPECT_EQ("123", Format("%d", 123)); EXPECT_EQ("123", Format("%v", 123)); - EXPECT_EQ("042", Format("%03d", 42)); - EXPECT_EQ("42", Format("%01d", 42)); - + EXPECT_EQ("042", Format("%03d", 42)); + EXPECT_EQ("42", Format("%01d", 42)); + EXPECT_EQ("2147483647", Format("%d", std::numeric_limits<i32>::max())); EXPECT_EQ("-2147483648", Format("%d", std::numeric_limits<i32>::min())); |