|
10 | 10 | #define TEST_STD_UTILITIES_FORMAT_FORMAT_RANGE_FORMAT_RANGE_FMTMAP_FORMAT_FUNCTIONS_TESTS_H
|
11 | 11 |
|
12 | 12 | #include <algorithm>
|
| 13 | +#include <deque> |
| 14 | +#include <flat_map> |
13 | 15 | #include <format>
|
14 | 16 | #include <map>
|
15 | 17 | #include <unordered_map>
|
@@ -241,10 +243,7 @@ void test_char_to_wchar(TestFunction check, ExceptionTest check_exception) {
|
241 | 243 | // Bool
|
242 | 244 | //
|
243 | 245 | template <class CharT, class TestFunction, class ExceptionTest>
|
244 |
| -void test_bool(TestFunction check, ExceptionTest check_exception) { |
245 |
| - // duplicates are stored in order of insertion |
246 |
| - std::multimap<bool, int> input{{true, 42}, {false, 0}, {true, 1}}; |
247 |
| - |
| 246 | +void test_bool(TestFunction check, ExceptionTest check_exception, auto&& input) { |
248 | 247 | check(SV("{false: 0, true: 42, true: 1}"), SV("{}"), input);
|
249 | 248 | check(SV("{false: 0, true: 42, true: 1}^42"), SV("{}^42"), input);
|
250 | 249 | check(SV("{false: 0, true: 42, true: 1}^42"), SV("{:}^42"), input);
|
@@ -339,6 +338,17 @@ void test_bool(TestFunction check, ExceptionTest check_exception) {
|
339 | 338 | "The argument index value is too large for the number of arguments supplied", SV("{:^^{}:#>{}}"), input, 41);
|
340 | 339 | }
|
341 | 340 |
|
| 341 | +template <class CharT, class TestFunction, class ExceptionTest> |
| 342 | +void test_bool(TestFunction check, ExceptionTest check_exception) { |
| 343 | + // duplicates are stored in order of insertion |
| 344 | + test_bool<CharT>(check, check_exception, std::multimap<bool, int>{{true, 42}, {false, 0}, {true, 1}}); |
| 345 | +#if TEST_STD_VER >= 23 |
| 346 | + test_bool<CharT>(check, |
| 347 | + check_exception, |
| 348 | + std::flat_multimap<bool, int, std::less<bool>, std::deque<bool>>{{true, 42}, {false, 0}, {true, 1}}); |
| 349 | +#endif |
| 350 | +} |
| 351 | + |
342 | 352 | //
|
343 | 353 | // Integral
|
344 | 354 | //
|
@@ -442,6 +452,9 @@ void test_int(TestFunction check, ExceptionTest check_exception, auto&& input) {
|
442 | 452 | template <class CharT, class TestFunction, class ExceptionTest>
|
443 | 453 | void test_int(TestFunction check, ExceptionTest check_exception) {
|
444 | 454 | test_int<CharT>(check, check_exception, std::map<int, int>{{1, -1}, {42, -42}, {-42, 42}});
|
| 455 | +#if TEST_STD_VER >= 23 |
| 456 | + test_int<CharT>(check, check_exception, std::flat_map<int, int>{{1, -1}, {42, -42}, {-42, 42}}); |
| 457 | +#endif |
445 | 458 | }
|
446 | 459 |
|
447 | 460 | //
|
|
0 commit comments