From dd25ea926c2e37dbd426f8dfb810a3e722ad06b5 Mon Sep 17 00:00:00 2001 From: Nikhil Date: Thu, 22 May 2025 13:45:50 +0530 Subject: [PATCH] Add test case for introduced function count_code_points_with_display_width_precision --- test/format-test.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/format-test.cc b/test/format-test.cc index 0d931e4b..f773e9f3 100644 --- a/test/format-test.cc +++ b/test/format-test.cc @@ -210,6 +210,12 @@ TEST(format_impl_test, compute_width) { EXPECT_EQ(fmt::detail::compute_width("вожык"), 5); } +TEST(format_impl_test, count_code_points_with_display_width_precision) { + EXPECT_EQ( + fmt::detail::count_code_points_with_display_width_precision("🐱🐱🐱", 5), + 2); +} + TEST(util_test, utf8_to_utf16) { auto u = fmt::detail::utf8_to_utf16("лошадка"); EXPECT_EQ(L"\x043B\x043E\x0448\x0430\x0434\x043A\x0430", u.str());