[base] Added to_uint base for string_view.

Signed-off-by: Viktor Govako <viktor.govako@gmail.com>
This commit is contained in:
Viktor Govako
2025-07-05 11:18:08 -03:00
committed by Konstantin Pastbin
parent 1d29e7816a
commit 72ff90defd
2 changed files with 8 additions and 4 deletions

View File

@@ -269,7 +269,11 @@ UNIT_TEST(to_uint)
TEST(strings::to_uint("AF", i, 16), ());
TEST_EQUAL(175, i, ());
TEST(strings::to_uint(std::string_view("C8"), i, 16), ());
TEST_EQUAL(200, i, ());
TEST(!strings::to_uint("AXF", i, 16), ());
TEST(!strings::to_uint(std::string_view("AXF"), i, 16), ());
uint8_t i8;
TEST(!strings::to_uint(std::string_view("256"), i8), ());