@@ -30,6 +30,8 @@ template <class CharT, class TestFunction, class ExceptionTest>
30
30
void test_char_default (TestFunction check, ExceptionTest check_exception, auto && input) {
31
31
// Note when no range-underlying-spec is present the char is escaped,
32
32
check (SV (" ['H', 'e', 'l', 'l', 'o']" ), SV (" {}" ), input);
33
+ check (SV (" ['H', 'e', 'l', 'l', 'o']^42" ), SV (" {}^42" ), input);
34
+ check (SV (" ['H', 'e', 'l', 'l', 'o']^42" ), SV (" {:}^42" ), input);
33
35
34
36
// when one is present there is no escaping,
35
37
check (SV (" [H, e, l, l, o]" ), SV (" {::}" ), input);
@@ -49,7 +51,7 @@ void test_char_default(TestFunction check, ExceptionTest check_exception, auto&&
49
51
check (SV (" __['H', 'e', 'l', 'l', 'o']___" ), SV (" {:_^{}}" ), input, 30 );
50
52
check (SV (" #####['H', 'e', 'l', 'l', 'o']" ), SV (" {:#>{}}" ), input, 30 );
51
53
52
- check_exception (" The fill option contains an invalid value " , SV (" {:}<}" ), input);
54
+ check_exception (" The format string contains an invalid escape sequence " , SV (" {:}<}" ), input);
53
55
check_exception (" The fill option contains an invalid value" , SV (" {:{<}" ), input);
54
56
check_exception (" The fill option contains an invalid value" , SV (" {::<}" ), input);
55
57
@@ -89,7 +91,7 @@ void test_char_default(TestFunction check, ExceptionTest check_exception, auto&&
89
91
check (SV (" [_H__, _e__, _l__, _l__, _o__]" ), SV (" {::_^{}}" ), input, 4 );
90
92
check (SV (" [:::H, :::e, :::l, :::l, :::o]" ), SV (" {:::>{}}" ), input, 4 );
91
93
92
- check_exception (" The fill option contains an invalid value " , SV (" {::}<}" ), input);
94
+ check_exception (" The format string contains an invalid escape sequence " , SV (" {::}<}" ), input);
93
95
check_exception (" The fill option contains an invalid value" , SV (" {::{<}" ), input);
94
96
95
97
// *** sign ***
@@ -149,7 +151,7 @@ void test_char_string(TestFunction check, ExceptionTest check_exception, auto&&
149
151
check (SV (" _Hello__" ), SV (" {:_^{}s}" ), input, 8 );
150
152
check (SV (" ###Hello" ), SV (" {:#>{}s}" ), input, 8 );
151
153
152
- check_exception (" The fill option contains an invalid value " , SV (" {:}<s}" ), input);
154
+ check_exception (" The format string contains an invalid escape sequence " , SV (" {:}<s}" ), input);
153
155
check_exception (" The fill option contains an invalid value" , SV (" {:{<s}" ), input);
154
156
check_exception (" The fill option contains an invalid value" , SV (" {::<s}" ), input);
155
157
@@ -202,7 +204,7 @@ void test_char_escaped_string(TestFunction check, ExceptionTest check_exception,
202
204
check (SV (R"( _"Hello"__)" ), SV (" {:_^{}?s}" ), input, 10 );
203
205
check (SV (R"( ###"Hello")" ), SV (" {:#>{}?s}" ), input, 10 );
204
206
205
- check_exception (" The fill option contains an invalid value " , SV (" {:}<?s}" ), input);
207
+ check_exception (" The format string contains an invalid escape sequence " , SV (" {:}<?s}" ), input);
206
208
check_exception (" The fill option contains an invalid value" , SV (" {:{<?s}" ), input);
207
209
check_exception (" The fill option contains an invalid value" , SV (" {::<?s}" ), input);
208
210
@@ -304,6 +306,8 @@ void test_char_to_wchar(TestFunction check, ExceptionTest check_exception) {
304
306
template <class CharT , class TestFunction , class ExceptionTest >
305
307
void test_bool (TestFunction check, ExceptionTest check_exception, auto && input) {
306
308
check (SV (" [true, true, false]" ), SV (" {}" ), input);
309
+ check (SV (" [true, true, false]^42" ), SV (" {}^42" ), input);
310
+ check (SV (" [true, true, false]^42" ), SV (" {:}^42" ), input);
307
311
308
312
// ***** underlying has no format-spec
309
313
@@ -318,7 +322,7 @@ void test_bool(TestFunction check, ExceptionTest check_exception, auto&& input)
318
322
check (SV (" __[true, true, false]___" ), SV (" {:_^{}}" ), input, 24 );
319
323
check (SV (" #####[true, true, false]" ), SV (" {:#>{}}" ), input, 24 );
320
324
321
- check_exception (" The fill option contains an invalid value " , SV (" {:}<}" ), input);
325
+ check_exception (" The format string contains an invalid escape sequence " , SV (" {:}<}" ), input);
322
326
check_exception (" The fill option contains an invalid value" , SV (" {:{<}" ), input);
323
327
check_exception (" The fill option contains an invalid value" , SV (" {::<}" ), input);
324
328
@@ -360,7 +364,7 @@ void test_bool(TestFunction check, ExceptionTest check_exception, auto&& input)
360
364
check (SV (" [_true__, _true__, _false_]" ), SV (" {::_^{}}" ), input, 7 );
361
365
check (SV (" [:::true, :::true, ::false]" ), SV (" {:::>{}}" ), input, 7 );
362
366
363
- check_exception (" The fill option contains an invalid value " , SV (" {::}<}" ), input);
367
+ check_exception (" The format string contains an invalid escape sequence " , SV (" {::}<}" ), input);
364
368
check_exception (" The fill option contains an invalid value" , SV (" {::{<}" ), input);
365
369
366
370
// *** sign ***
@@ -418,6 +422,8 @@ void test_bool(TestFunction check, ExceptionTest check_exception) {
418
422
template <class CharT , class TestFunction , class ExceptionTest >
419
423
void test_int (TestFunction check, ExceptionTest check_exception, auto && input) {
420
424
check (SV (" [-42, 1, 2, 42]" ), SV (" {}" ), input);
425
+ check (SV (" [-42, 1, 2, 42]^42" ), SV (" {}^42" ), input);
426
+ check (SV (" [-42, 1, 2, 42]^42" ), SV (" {:}^42" ), input);
421
427
422
428
// ***** underlying has no format-spec
423
429
@@ -432,7 +438,7 @@ void test_int(TestFunction check, ExceptionTest check_exception, auto&& input) {
432
438
check (SV (" __[-42, 1, 2, 42]___" ), SV (" {:_^{}}" ), input, 20 );
433
439
check (SV (" #####[-42, 1, 2, 42]" ), SV (" {:#>{}}" ), input, 20 );
434
440
435
- check_exception (" The fill option contains an invalid value " , SV (" {:}<}" ), input);
441
+ check_exception (" The format string contains an invalid escape sequence " , SV (" {:}<}" ), input);
436
442
check_exception (" The fill option contains an invalid value" , SV (" {:{<}" ), input);
437
443
check_exception (" The fill option contains an invalid value" , SV (" {::<}" ), input);
438
444
@@ -474,7 +480,7 @@ void test_int(TestFunction check, ExceptionTest check_exception, auto&& input) {
474
480
check (SV (" [_-42_, __1__, __2__, _42__]" ), SV (" {::_^{}}" ), input, 5 );
475
481
check (SV (" [::-42, ::::1, ::::2, :::42]" ), SV (" {:::>{}}" ), input, 5 );
476
482
477
- check_exception (" The fill option contains an invalid value " , SV (" {::}<}" ), input);
483
+ check_exception (" The format string contains an invalid escape sequence " , SV (" {::}<}" ), input);
478
484
check_exception (" The fill option contains an invalid value" , SV (" {::{<}" ), input);
479
485
480
486
// *** sign ***
@@ -526,6 +532,8 @@ void test_int(TestFunction check, ExceptionTest check_exception) {
526
532
template <class CharT , class TestFunction , class ExceptionTest >
527
533
void test_floating_point (TestFunction check, ExceptionTest check_exception, auto && input) {
528
534
check (SV (" [-42.5, 0, 1.25, 42.5]" ), SV (" {}" ), input);
535
+ check (SV (" [-42.5, 0, 1.25, 42.5]^42" ), SV (" {}^42" ), input);
536
+ check (SV (" [-42.5, 0, 1.25, 42.5]^42" ), SV (" {:}^42" ), input);
529
537
530
538
// ***** underlying has no format-spec
531
539
@@ -540,7 +548,7 @@ void test_floating_point(TestFunction check, ExceptionTest check_exception, auto
540
548
check (SV (" __[-42.5, 0, 1.25, 42.5]___" ), SV (" {:_^{}}" ), input, 27 );
541
549
check (SV (" #####[-42.5, 0, 1.25, 42.5]" ), SV (" {:#>{}}" ), input, 27 );
542
550
543
- check_exception (" The fill option contains an invalid value " , SV (" {:}<}" ), input);
551
+ check_exception (" The format string contains an invalid escape sequence " , SV (" {:}<}" ), input);
544
552
check_exception (" The fill option contains an invalid value" , SV (" {:{<}" ), input);
545
553
check_exception (" The fill option contains an invalid value" , SV (" {::<}" ), input);
546
554
@@ -582,7 +590,7 @@ void test_floating_point(TestFunction check, ExceptionTest check_exception, auto
582
590
check (SV (" [-42.5, __0__, 1.25_, 42.5_]" ), SV (" {::_^{}}" ), input, 5 );
583
591
check (SV (" [-42.5, ::::0, :1.25, :42.5]" ), SV (" {:::>{}}" ), input, 5 );
584
592
585
- check_exception (" The fill option contains an invalid value " , SV (" {::}<}" ), input);
593
+ check_exception (" The format string contains an invalid escape sequence " , SV (" {::}<}" ), input);
586
594
check_exception (" The fill option contains an invalid value" , SV (" {::{<}" ), input);
587
595
588
596
// *** sign ***
@@ -662,6 +670,8 @@ void test_floating_point(TestFunction check, ExceptionTest check_exception) {
662
670
template <class CharT , class TestFunction , class ExceptionTest >
663
671
void test_pointer (TestFunction check, ExceptionTest check_exception, auto && input) {
664
672
check (SV (" [0x0]" ), SV (" {}" ), input);
673
+ check (SV (" [0x0]^42" ), SV (" {}^42" ), input);
674
+ check (SV (" [0x0]^42" ), SV (" {:}^42" ), input);
665
675
666
676
// ***** underlying has no format-spec
667
677
@@ -676,7 +686,7 @@ void test_pointer(TestFunction check, ExceptionTest check_exception, auto&& inpu
676
686
check (SV (" __[0x0]___" ), SV (" {:_^{}}" ), input, 10 );
677
687
check (SV (" #####[0x0]" ), SV (" {:#>{}}" ), input, 10 );
678
688
679
- check_exception (" The fill option contains an invalid value " , SV (" {:}<}" ), input);
689
+ check_exception (" The format string contains an invalid escape sequence " , SV (" {:}<}" ), input);
680
690
check_exception (" The fill option contains an invalid value" , SV (" {:{<}" ), input);
681
691
check_exception (" The fill option contains an invalid value" , SV (" {::<}" ), input);
682
692
@@ -716,7 +726,7 @@ void test_pointer(TestFunction check, ExceptionTest check_exception, auto&& inpu
716
726
check (SV (" [_0x0_]" ), SV (" {::_^{}}" ), input, 5 );
717
727
check (SV (" [::0x0]" ), SV (" {:::>{}}" ), input, 5 );
718
728
719
- check_exception (" The fill option contains an invalid value " , SV (" {::}<}" ), input);
729
+ check_exception (" The format string contains an invalid escape sequence " , SV (" {::}<}" ), input);
720
730
check_exception (" The fill option contains an invalid value" , SV (" {::{<}" ), input);
721
731
722
732
// *** sign ***
@@ -770,6 +780,8 @@ void test_pointer(TestFunction check, ExceptionTest check_exception) {
770
780
template <class CharT , class TestFunction , class ExceptionTest >
771
781
void test_string (TestFunction check, ExceptionTest check_exception, auto && input) {
772
782
check (SV (R"( ["Hello", "world"])" ), SV (" {}" ), input);
783
+ check (SV (R"( ["Hello", "world"]^42)" ), SV (" {}^42" ), input);
784
+ check (SV (R"( ["Hello", "world"]^42)" ), SV (" {:}^42" ), input);
773
785
774
786
// ***** underlying has no format-spec
775
787
@@ -784,7 +796,7 @@ void test_string(TestFunction check, ExceptionTest check_exception, auto&& input
784
796
check (SV (R"( __["Hello", "world"]___)" ), SV (" {:_^{}}" ), input, 23 );
785
797
check (SV (R"( #####["Hello", "world"])" ), SV (" {:#>{}}" ), input, 23 );
786
798
787
- check_exception (" The fill option contains an invalid value " , SV (" {:}<}" ), input);
799
+ check_exception (" The format string contains an invalid escape sequence " , SV (" {:}<}" ), input);
788
800
check_exception (" The fill option contains an invalid value" , SV (" {:{<}" ), input);
789
801
check_exception (" The fill option contains an invalid value" , SV (" {::<}" ), input);
790
802
@@ -824,7 +836,7 @@ void test_string(TestFunction check, ExceptionTest check_exception, auto&& input
824
836
check (SV (R"( [_Hello__, _world__])" ), SV (" {::_^{}}" ), input, 8 );
825
837
check (SV (R"( [:::Hello, :::world])" ), SV (" {:::>{}}" ), input, 8 );
826
838
827
- check_exception (" The fill option contains an invalid value " , SV (" {::}<}" ), input);
839
+ check_exception (" The format string contains an invalid escape sequence " , SV (" {::}<}" ), input);
828
840
check_exception (" The fill option contains an invalid value" , SV (" {::{<}" ), input);
829
841
830
842
// *** sign ***
@@ -880,6 +892,8 @@ void test_string(TestFunction check, ExceptionTest check_exception) {
880
892
template <class CharT , class TestFunction , class ExceptionTest >
881
893
void test_status (TestFunction check, ExceptionTest check_exception, auto && input) {
882
894
check (SV (" [0xaaaa, 0x5555, 0xaa55]" ), SV (" {}" ), input);
895
+ check (SV (" [0xaaaa, 0x5555, 0xaa55]^42" ), SV (" {}^42" ), input);
896
+ check (SV (" [0xaaaa, 0x5555, 0xaa55]^42" ), SV (" {:}^42" ), input);
883
897
884
898
// ***** underlying has no format-spec
885
899
@@ -894,7 +908,7 @@ void test_status(TestFunction check, ExceptionTest check_exception, auto&& input
894
908
check (SV (" __[0xaaaa, 0x5555, 0xaa55]___" ), SV (" {:_^{}}" ), input, 29 );
895
909
check (SV (" #####[0xaaaa, 0x5555, 0xaa55]" ), SV (" {:#>{}}" ), input, 29 );
896
910
897
- check_exception (" The fill option contains an invalid value " , SV (" {:}<}" ), input);
911
+ check_exception (" The format string contains an invalid escape sequence " , SV (" {:}<}" ), input);
898
912
check_exception (" The fill option contains an invalid value" , SV (" {:{<}" ), input);
899
913
check_exception (" The fill option contains an invalid value" , SV (" {::<}" ), input);
900
914
0 commit comments