]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libsdc++: Test using range_format::map as format_kind.
authorTomasz Kamiński <tkaminsk@redhat.com>
Tue, 29 Jul 2025 12:59:35 +0000 (14:59 +0200)
committerTomasz Kamiński <tkaminsk@redhat.com>
Tue, 29 Jul 2025 14:08:46 +0000 (16:08 +0200)
This adderess TODO from the test file.

libstdc++-v3/ChangeLog:

* testsuite/std/format/ranges/format_kind.cc: New test.

Signed-off-by: Tomasz Kamiński <tkaminsk@redhat.com>
libstdc++-v3/testsuite/std/format/ranges/format_kind.cc

index 14b9ff20c2182c033ae007cb3b210373d53ba05f..1450fbaebc5950173ae9603c25c6a9bc94a9858c 100644 (file)
@@ -75,7 +75,9 @@ void test_override()
   CustFormat<int, std::range_format::set> setf{1, 2, 3};
   VERIFY( std::format("{}", setf) == "{1, 2, 3}" );
 
-  // TODO test map once formatter for pair is implenented
+  CustFormat<std::pair<int, int>, std::range_format::map> mapf
+  {{1, 11}, {2, 22}, {3, 33}};
+  VERIFY( std::format("{}", mapf) == "{1: 11, 2: 22, 3: 33}" );
 
   CustFormat<char, std::range_format::string> stringf{'a', 'b', 'c', 'd'};
   VERIFY( std::format("{}", stringf) == "abcd" );