Skip to content

Commit

Permalink
Add wchar_t test for gh_4320
Browse files Browse the repository at this point in the history
  • Loading branch information
Andor233 committed Aug 23, 2024
1 parent 2b3d3ec commit bb99f07
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tests/std/tests/P0645R10_text_formatting_formatting/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1521,9 +1521,10 @@ void test_gh_4319() {
}

// GH-4320: <format>: crash when formatting a floating-point value with #/L and a large precision
template <class charT>
void test_gh_4320() {
assert(format("{:#.1075e}", 1.0)
== "1."
assert(format(STR("{:#.1075e}"), 1.0)
== STR("1."
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
Expand All @@ -1534,7 +1535,7 @@ void test_gh_4320() {
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
"00000000000000000000000000000000000e+00");
"00000000000000000000000000000000000e+00"));
}

void test() {
Expand Down Expand Up @@ -1621,7 +1622,8 @@ void test() {

test_gh_4319<char>();
test_gh_4319<wchar_t>();
test_gh_4320();
test_gh_4320<char>();
test_gh_4320<wchar_t>();
}

int main() {
Expand Down

0 comments on commit bb99f07

Please sign in to comment.