| 1 | // { dg-do run { target c++20 } } |
| 2 | // { dg-require-namedlocale "fr_FR.ISO8859-15" } |
| 3 | // { dg-timeout-factor 2 } |
| 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 << Monday[2] << ' ' << Wednesday[5] << ' ' << Friday[13]; |
| 17 | VERIFY( ss.str() == "Mon[2] Wed[5] Fri[13 is not a valid index]" ); |
| 18 | |
| 19 | ss.str(""); |
| 20 | ss.imbue(std::locale(ISO_8859(15,fr_FR))); |
| 21 | ss << Saturday[1]; |
| 22 | VERIFY( ss.str() == "sam.[1]" ); |
| 23 | } |
| 24 | |
| 25 | int main() |
| 26 | { |
| 27 | test_ostream(); |
| 28 | // TODO: test_format(); |
| 29 | // TODO: test_parse(); |
| 30 | } |