]> gcc.gnu.org Git - gcc.git/blob - libstdc++-v3/testsuite/std/time/month_weekday_last/io.cc
libstdc++: Fix ostream insertion operators for calendar types
[gcc.git] / libstdc++-v3 / testsuite / std / time / month_weekday_last / io.cc
1 // { dg-options "-std=gnu++20" }
2 // { dg-do run { target c++20 } }
3 // { dg-require-namedlocale "fr_FR.ISO8859-15" }
4
5 #include <chrono>
6 #include <sstream>
7 #include <testsuite_hooks.h>
8
9 void
10 test_ostream()
11 {
12 using std::ostringstream;
13 using namespace std::chrono;
14
15 ostringstream ss;
16 ss << January/Saturday[last] << ' ' << February/Monday[last] << ' '
17 << March/weekday(9)[last];
18 VERIFY( ss.str() == "Jan/Sat[last] Feb/Mon[last] Mar/9 is not a valid weekday[last]" );
19
20 ss.str("");
21 ss.imbue(std::locale(ISO_8859(15,fr_FR)));
22 ss << July/Thursday[last];
23 VERIFY( ss.str() == "juil./jeu.[last]" );
24 }
25
26 int main()
27 {
28 test_ostream();
29 // TODO: test_format();
30 // TODO: test_parse();
31 }
This page took 0.036532 seconds and 5 git commands to generate.