@@ -75,30 +75,40 @@ void test() {
75
75
76
76
// Invalid Unicode Scalar Values
77
77
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
82
90
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
87
97
88
98
check_exception (" The format specifier contains malformed Unicode characters" ,
89
- SV ( " {:\x80 ^}" ) ,
99
+ std::string_view{ " {:\x80 ^}" } ,
90
100
42 ); // Trailing code unit with no leading one.
91
101
check_exception (" The format specifier contains malformed Unicode characters" ,
92
- SV ( " {:\xc0 ^}" ) ,
102
+ std::string_view{ " {:\xc0 ^}" } ,
93
103
42 ); // Missing trailing code unit.
94
104
check_exception (" The format specifier contains malformed Unicode characters" ,
95
- SV ( " {:\xe0\x80 ^}" ) ,
105
+ std::string_view{ " {:\xe0\x80 ^}" } ,
96
106
42 ); // Missing trailing code unit.
97
107
check_exception (" The format specifier contains malformed Unicode characters" ,
98
- SV ( " {:\xf0\x80 ^}" ) ,
108
+ std::string_view{ " {:\xf0\x80 ^}" } ,
99
109
42 ); // Missing two trailing code units.
100
110
check_exception (" The format specifier contains malformed Unicode characters" ,
101
- SV ( " {:\xf0\x80\x80 ^}" ) ,
111
+ std::string_view{ " {:\xf0\x80\x80 ^}" } ,
102
112
42 ); // Missing trailing code unit.
103
113
104
114
#ifndef TEST_HAS_NO_WIDE_CHARACTERS
0 commit comments