| 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 << January/Saturday[2] << ' ' << February/Monday[5] << ' ' |
| 17 |
<< March/Sunday[8]; |
| 18 |
VERIFY( ss.str() == "Jan/Sat[2] Feb/Mon[5] Mar/Sun[8 is not a valid index]" ); |
| 19 |
|
| 20 |
ss.str(""); |
| 21 |
ss.imbue(std::locale(ISO_8859(15,fr_FR))); |
| 22 |
ss << July/Thursday[4]; |
| 23 |
VERIFY( ss.str() == "juil./jeu.[4]" ); |
| 24 |
} |
| 25 |
|
| 26 |
int main() |
| 27 |
{ |
| 28 |
test_ostream(); |
| 29 |
// TODO: test_format(); |
| 30 |
// TODO: test_parse(); |
| 31 |
} |