@@ -34,7 +34,8 @@ TEST_CASE("format a static string", "[ct_format]") {
34
34
static_assert (stdx::ct_format<" Hello" >() == " Hello" _fmt_res);
35
35
}
36
36
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]" ) {
38
39
using namespace std ::string_view_literals;
39
40
static_assert (stdx::ct_format<" Hello {}" >(CX_VALUE (" world" sv)) ==
40
41
" Hello world" _fmt_res);
@@ -44,16 +45,34 @@ TEST_CASE("format a compile-time stringish argument", "[ct_format]") {
44
45
" Hello world" _fmt_res);
45
46
}
46
47
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]" ) {
48
57
static_assert (stdx::ct_format<" Hello {}" >(CX_VALUE (42 )) ==
49
58
" Hello 42" _fmt_res);
50
59
}
51
60
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]" ) {
53
67
static_assert (stdx::ct_format<" Hello {}" >(CX_VALUE (int )) ==
54
68
" Hello int" _fmt_res);
55
69
}
56
70
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
+
57
76
TEST_CASE (" format a compile-time argument with fmt spec" , " [ct_format]" ) {
58
77
static_assert (stdx::ct_format<" Hello {:*>#6x}" >(CX_VALUE (42 )) ==
59
78
" Hello **0x2a" _fmt_res);
@@ -63,11 +82,16 @@ namespace {
63
82
enum struct E { A };
64
83
}
65
84
66
- TEST_CASE (" format a compile-time enum argument" , " [ct_format]" ) {
85
+ TEST_CASE (" format a compile-time enum argument (CX_VALUE) " , " [ct_format]" ) {
67
86
static_assert (stdx::ct_format<" Hello {}" >(CX_VALUE (E::A)) ==
68
87
" Hello A" _fmt_res);
69
88
}
70
89
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
+
71
95
TEST_CASE (" format a runtime argument" , " [ct_format]" ) {
72
96
constexpr auto x = 17 ;
73
97
constexpr auto expected =
0 commit comments