@@ -34,7 +34,8 @@ TEST_CASE("format a static string", "[ct_format]") {
3434 static_assert (stdx::ct_format<" Hello" >() == " Hello" _fmt_res);
3535}
3636
37- TEST_CASE (" format a compile-time stringish argument" , " [ct_format]" ) {
37+ TEST_CASE (" format a compile-time stringish argument (CX_VALUE)" ,
38+ " [ct_format]" ) {
3839 using namespace std ::string_view_literals;
3940 static_assert (stdx::ct_format<" Hello {}" >(CX_VALUE (" world" sv)) ==
4041 " Hello world" _fmt_res);
@@ -44,16 +45,34 @@ TEST_CASE("format a compile-time stringish argument", "[ct_format]") {
4445 " Hello world" _fmt_res);
4546}
4647
47- TEST_CASE (" format a compile-time integral argument" , " [ct_format]" ) {
48+ TEST_CASE (" format a compile-time stringish argument (ct)" , " [ct_format]" ) {
49+ using namespace std ::string_view_literals;
50+ static_assert (stdx::ct_format<" Hello {}" >(" world" _ctst) ==
51+ " Hello world" _fmt_res);
52+ static_assert (stdx::ct_format<" Hello {}" >(stdx::ct<" world" >()) ==
53+ " Hello world" _fmt_res);
54+ }
55+
56+ TEST_CASE (" format a compile-time integral argument (CX_VALUE)" , " [ct_format]" ) {
4857 static_assert (stdx::ct_format<" Hello {}" >(CX_VALUE (42 )) ==
4958 " Hello 42" _fmt_res);
5059}
5160
52- TEST_CASE (" format a type argument" , " [ct_format]" ) {
61+ TEST_CASE (" format a compile-time integral argument (ct)" , " [ct_format]" ) {
62+ static_assert (stdx::ct_format<" Hello {}" >(stdx::ct<42 >()) ==
63+ " Hello 42" _fmt_res);
64+ }
65+
66+ TEST_CASE (" format a type argument (CX_VALUE)" , " [ct_format]" ) {
5367 static_assert (stdx::ct_format<" Hello {}" >(CX_VALUE (int )) ==
5468 " Hello int" _fmt_res);
5569}
5670
71+ TEST_CASE (" format a type argument (ct)" , " [ct_format]" ) {
72+ static_assert (stdx::ct_format<" Hello {}" >(stdx::ct<int >()) ==
73+ " Hello int" _fmt_res);
74+ }
75+
5776TEST_CASE (" format a compile-time argument with fmt spec" , " [ct_format]" ) {
5877 static_assert (stdx::ct_format<" Hello {:*>#6x}" >(CX_VALUE (42 )) ==
5978 " Hello **0x2a" _fmt_res);
@@ -63,11 +82,16 @@ namespace {
6382enum struct E { A };
6483}
6584
66- TEST_CASE (" format a compile-time enum argument" , " [ct_format]" ) {
85+ TEST_CASE (" format a compile-time enum argument (CX_VALUE) " , " [ct_format]" ) {
6786 static_assert (stdx::ct_format<" Hello {}" >(CX_VALUE (E::A)) ==
6887 " Hello A" _fmt_res);
6988}
7089
90+ TEST_CASE (" format a compile-time enum argument (ct)" , " [ct_format]" ) {
91+ static_assert (stdx::ct_format<" Hello {}" >(stdx::ct<E::A>()) ==
92+ " Hello A" _fmt_res);
93+ }
94+
7195TEST_CASE (" format a runtime argument" , " [ct_format]" ) {
7296 constexpr auto x = 17 ;
7397 constexpr auto expected =
0 commit comments