diff options
author | osidorkin <osidorkin@yandex-team.com> | 2023-03-25 23:48:17 +0300 |
---|---|---|
committer | osidorkin <osidorkin@yandex-team.com> | 2023-03-25 23:48:17 +0300 |
commit | de6ae0b6ef2b4129fea2ba2e60ab0223c912423c (patch) | |
tree | 62e03d36c876d2319111402173145aadc78bb1d5 /util/string/cast_ut.cpp | |
parent | a50a4399c2600b05a086acdca3ba56c957d62196 (diff) | |
download | ydb-de6ae0b6ef2b4129fea2ba2e60ab0223c912423c.tar.gz |
More precise buffer allocation based on base and type, more tests
Diffstat (limited to 'util/string/cast_ut.cpp')
-rw-r--r-- | util/string/cast_ut.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/util/string/cast_ut.cpp b/util/string/cast_ut.cpp index 0ff92e379b..662833c700 100644 --- a/util/string/cast_ut.cpp +++ b/util/string/cast_ut.cpp @@ -598,5 +598,11 @@ Y_UNIT_TEST_SUITE(TCastTest) { constexpr auto v = TIntStringBuf(-1111); UNIT_ASSERT_VALUES_EQUAL(TStringBuf(v), TStringBuf(ToString(-1111))); + UNIT_ASSERT_VALUES_EQUAL(TStringBuf(TIntStringBuf<ui16>(65535)), TStringBuf("65535")); + UNIT_ASSERT_VALUES_EQUAL(TStringBuf(TIntStringBuf<i16>(32767)), TStringBuf("32767")); + UNIT_ASSERT_VALUES_EQUAL(TStringBuf(TIntStringBuf<i32>(-32768)), TStringBuf("-32768")); + + UNIT_ASSERT_VALUES_EQUAL(TStringBuf(TIntStringBuf<i8, 2>(127)), TStringBuf("1111111")); + UNIT_ASSERT_VALUES_EQUAL(TStringBuf(TIntStringBuf<i8, 2>(-128)), TStringBuf("-10000000")); } }; |