@@ -75,30 +75,40 @@ void test() {
7575
7676 // Invalid Unicode Scalar Values
7777 if constexpr (std::same_as<CharT, char >) {
78- check_exception (" The format specifier contains malformed Unicode characters" , SV (" {:\xed\xa0\x80 ^}" ), 42 ); // U+D800
79- check_exception (" The format specifier contains malformed Unicode characters" , SV (" {:\xed\xa0\xbf ^}" ), 42 ); // U+DBFF
80- check_exception (" The format specifier contains malformed Unicode characters" , SV (" {:\xed\xbf\x80 ^}" ), 42 ); // U+DC00
81- check_exception (" The format specifier contains malformed Unicode characters" , SV (" {:\xed\xbf\xbf ^}" ), 42 ); // U+DFFF
78+ check_exception (" The format specifier contains malformed Unicode characters" ,
79+ std::string_view{" {:\xed\xa0\x80 ^}" },
80+ 42 ); // U+D800
81+ check_exception (" The format specifier contains malformed Unicode characters" ,
82+ std::string_view{" {:\xed\xa0\xbf ^}" },
83+ 42 ); // U+DBFF
84+ check_exception (" The format specifier contains malformed Unicode characters" ,
85+ std::string_view{" {:\xed\xbf\x80 ^}" },
86+ 42 ); // U+DC00
87+ check_exception (" The format specifier contains malformed Unicode characters" ,
88+ std::string_view{" {:\xed\xbf\xbf ^}" },
89+ 42 ); // U+DFFF
8290
83- check_exception (
84- " The format specifier contains malformed Unicode characters" , SV (" {:\xf4\x90\x80\x80 ^}" ), 42 ); // U+110000
85- check_exception (
86- " The format specifier contains malformed Unicode characters" , SV (" {:\xf4\x90\xbf\xbf ^}" ), 42 ); // U+11FFFF
91+ check_exception (" The format specifier contains malformed Unicode characters" ,
92+ std::string_view{" {:\xf4\x90\x80\x80 ^}" },
93+ 42 ); // U+110000
94+ check_exception (" The format specifier contains malformed Unicode characters" ,
95+ std::string_view{" {:\xf4\x90\xbf\xbf ^}" },
96+ 42 ); // U+11FFFF
8797
8898 check_exception (" The format specifier contains malformed Unicode characters" ,
89- SV ( " {:\x80 ^}" ) ,
99+ std::string_view{ " {:\x80 ^}" } ,
90100 42 ); // Trailing code unit with no leading one.
91101 check_exception (" The format specifier contains malformed Unicode characters" ,
92- SV ( " {:\xc0 ^}" ) ,
102+ std::string_view{ " {:\xc0 ^}" } ,
93103 42 ); // Missing trailing code unit.
94104 check_exception (" The format specifier contains malformed Unicode characters" ,
95- SV ( " {:\xe0\x80 ^}" ) ,
105+ std::string_view{ " {:\xe0\x80 ^}" } ,
96106 42 ); // Missing trailing code unit.
97107 check_exception (" The format specifier contains malformed Unicode characters" ,
98- SV ( " {:\xf0\x80 ^}" ) ,
108+ std::string_view{ " {:\xf0\x80 ^}" } ,
99109 42 ); // Missing two trailing code units.
100110 check_exception (" The format specifier contains malformed Unicode characters" ,
101- SV ( " {:\xf0\x80\x80 ^}" ) ,
111+ std::string_view{ " {:\xf0\x80\x80 ^}" } ,
102112 42 ); // Missing trailing code unit.
103113
104114#ifndef TEST_HAS_NO_WIDE_CHARACTERS
0 commit comments