aboutsummaryrefslogtreecommitdiffstats
path: root/util/string/cast_ut.cpp
diff options
context:
space:
mode:
authorosidorkin <osidorkin@yandex-team.com>2023-03-25 23:48:17 +0300
committerosidorkin <osidorkin@yandex-team.com>2023-03-25 23:48:17 +0300
commitde6ae0b6ef2b4129fea2ba2e60ab0223c912423c (patch)
tree62e03d36c876d2319111402173145aadc78bb1d5 /util/string/cast_ut.cpp
parenta50a4399c2600b05a086acdca3ba56c957d62196 (diff)
downloadydb-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.cpp6
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"));
}
};