Skip to content

Commit 396feb6

Browse files
committed
add char8_t test
1 parent 2c4b48d commit 396feb6

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

tests/BUILD.bazel

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ cc_test(
9898
)
9999

100100
cc_test(
101-
name = "unicode_test",
102-
srcs = ["unicode_test.cpp"],
101+
name = "supported_chars_test",
102+
srcs = ["supported_chars_test.cpp"],
103103
deps = [
104104
"//:fast_float",
105105
"@doctest//doctest",

tests/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ endfunction(fast_float_add_cpp_test)
6868

6969
fast_float_add_cpp_test(rcppfastfloat_test)
7070
fast_float_add_cpp_test(wide_char_test)
71-
fast_float_add_cpp_test(unicode_test)
71+
fast_float_add_cpp_test(supported_chars_test)
7272
fast_float_add_cpp_test(example_test)
7373
fast_float_add_cpp_test(example_comma_test)
7474
fast_float_add_cpp_test(basictest)

tests/unicode_test.cpp renamed to tests/supported_chars_test.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@ int main() {
3131
return EXIT_FAILURE;
3232
}
3333

34+
#ifdef __cpp_char8_t
35+
if (!test<char8_t>("4.2", 4.2)) {
36+
std::cout << "test failure for char8_t" << std::endl;
37+
return EXIT_FAILURE;
38+
}
39+
#endif
40+
3441
if (!test<char16_t>("4.2", 4.2)) {
3542
std::cout << "test failure for char16_t" << std::endl;
3643
return EXIT_FAILURE;

0 commit comments

Comments
 (0)