summaryrefslogtreecommitdiff
path: root/libstdc++-v3/testsuite/std/time/weekday_indexed/io.cc
blob: cdb91f4ba1131c5ae35e38e8690ffcf229a8940c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// { dg-options "-std=gnu++20" }
// { dg-do run { target c++20 } }
// { dg-require-namedlocale "fr_FR.ISO8859-15" }

#include <chrono>
#include <sstream>
#include <testsuite_hooks.h>

void
test_ostream()
{
  using std::ostringstream;
  using namespace std::chrono;

  ostringstream ss;
  ss << Monday[2] << ' ' << Wednesday[5] << ' ' << Friday[13];
  VERIFY( ss.str() == "Mon[2] Wed[5] Fri[13 is not a valid index]" );

  ss.str("");
  ss.imbue(std::locale(ISO_8859(15,fr_FR)));
  ss << Saturday[1];
  VERIFY( ss.str() == "sam.[1]" );
}

int main()
{
  test_ostream();
  // TODO: test_format();
  // TODO: test_parse();
}