From 4658907091922c6d0803fa1b101676c1c95062fe Mon Sep 17 00:00:00 2001 From: Ruben Perez Date: Sun, 31 Dec 2023 08:45:14 +0100 Subject: [PATCH] latin1 tests --- test/unit/test/character_set.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/unit/test/character_set.cpp b/test/unit/test/character_set.cpp index c67590325..e02179996 100644 --- a/test/unit/test/character_set.cpp +++ b/test/unit/test/character_set.cpp @@ -448,4 +448,17 @@ BOOST_AUTO_TEST_CASE(utf8mb4_invalid_continuation) } } +BOOST_AUTO_TEST_CASE(latin1) +{ + for (std::size_t i = 0; i <= 0xff; ++i) + { + BOOST_TEST_CONTEXT(i) + { + char str[2]{static_cast(i), '\0'}; + auto size = latin1_charset.next_char(string_view(str, 2)); + BOOST_TEST(size == 1u); + } + } +} + BOOST_AUTO_TEST_SUITE_END() \ No newline at end of file