--- nono/lib/test_mystring.cpp 2026/04/29 17:04:57 1.1.1.2 +++ nono/lib/test_mystring.cpp 2026/04/29 17:05:08 1.1.1.3 @@ -201,6 +201,7 @@ class Test_MyString : public TestClass TESTDEF(startwith_ignorecase_1); TESTDEF(string_split_1); TESTDEF(string_split_2); + TESTDEF(format_number_1); } void string_ltrim_1() { @@ -379,6 +380,27 @@ class Test_MyString : public TestClass xp_eq(exp, string_split(src, ',', num), t); } } + + void format_number_1() { + TestTable table = { + { 0, "0" }, + { 1, "1" }, + { 999, "999" }, + { 1000, "1,000" }, + { 12345, "12,345" }, + { 123456, "123,456" }, + { 9876543, "9,876,543" }, + { 987654321, "987,654,321" }, + { 1000000000, "1,000,000,000" }, + }; + + for (const auto& t : table) { + auto val = t.get<0>(); + const auto& exp = t.get<1>(); + + xp_eq(exp, format_number(val), t); + } + } }; int