Skip to content

Commit 7f71c5b

Browse files
Test non-strictly null terminated arrays
1 parent 9a1911a commit 7f71c5b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

libcxx/test/std/utilities/format/format.functions/format_tests.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3194,6 +3194,9 @@ void format_tests(TestFunction check, ExceptionTest check_exception) {
31943194
// Contents after the embedded null character are discarded.
31953195
CharT buffer[] = {CharT('a'), CharT('b'), CharT('c'), 0, CharT('d'), CharT('e'), CharT('f'), 0};
31963196
check(SV("hello abc"), SV("hello {}"), buffer);
3197+
// Even when the last element of the array is not null character.
3198+
CharT buffer2[] = {CharT('a'), CharT('b'), CharT('c'), 0, CharT('d'), CharT('e'), CharT('f')};
3199+
check(SV("hello abc"), SV("hello {}"), buffer2);
31973200
}
31983201
{
31993202
std::basic_string<CharT> data = STR("world");

0 commit comments

Comments
 (0)