@@ -135,19 +135,13 @@ TEST_CASE("format multiple mixed arguments", "[ct_format]") {
135
135
stdx::make_tuple (42 , " B" sv)});
136
136
}
137
137
138
- TEST_CASE (" format a formatted string " , " [ct_format]" ) {
138
+ TEST_CASE (" format a format result " , " [ct_format]" ) {
139
139
static_assert (stdx::ct_format<" The value is {}." >(
140
- CX_VALUE ( stdx::ct_format<" (year={})" >(2022 ) )) ==
140
+ stdx::ct_format<" (year={})" >(2022 )) ==
141
141
stdx::format_result{" The value is (year={})." _ctst,
142
142
stdx::make_tuple (2022 )});
143
143
}
144
144
145
- TEST_CASE (" format a ct-formatted string" , " [ct_format]" ) {
146
- constexpr static auto cts = stdx::ct_format<" (year={})" >(CX_VALUE (2024 ));
147
- static_assert (stdx::ct_format<" The value is {}." >(CX_VALUE (cts)) ==
148
- " The value is (year=2024)." _fmt_res);
149
- }
150
-
151
145
namespace {
152
146
template <typename T, T...> struct string_constant {
153
147
private:
@@ -182,23 +176,14 @@ TEST_CASE("format a string-type argument", "[ct_format]") {
182
176
" Hello A!" _fmt_res);
183
177
}
184
178
185
- TEST_CASE (" format a formatted string with different type" , " [ct_format]" ) {
186
- static_assert (stdx::ct_format<" A{}D" , string_constant>(CX_VALUE (
187
- stdx::ct_format<" B{}C" , string_constant>(2022 ))) ==
179
+ TEST_CASE (" format a format result with different type" , " [ct_format]" ) {
180
+ static_assert (stdx::ct_format<" A{}D" , string_constant>(
181
+ stdx::ct_format<" B{}C" , string_constant>(2022 )) ==
188
182
stdx::format_result{
189
183
string_constant<char , ' A' , ' B' , ' {' , ' }' , ' C' , ' D' >{},
190
184
stdx::make_tuple (2022 )});
191
185
}
192
186
193
- TEST_CASE (" format a ct-formatted string with different type" , " [ct_format]" ) {
194
- constexpr static auto cts =
195
- stdx::ct_format<" B{}C" , string_constant>(CX_VALUE (2024 ));
196
- static_assert (
197
- stdx::ct_format<" A{}D" , string_constant>(CX_VALUE (cts)) ==
198
- stdx::format_result{
199
- string_constant<char , ' A' , ' B' , ' 2' , ' 0' , ' 2' , ' 4' , ' C' , ' D' >{}});
200
- }
201
-
202
187
TEST_CASE (" format multiple mixed arguments with different type" ,
203
188
" [ct_format]" ) {
204
189
using namespace std ::string_view_literals;
0 commit comments