]> git.ipfire.org Git - thirdparty/gcc.git/blame - libstdc++-v3/testsuite/27_io/manipulators/standard/char/dr2344.cc
Update copyright years.
[thirdparty/gcc.git] / libstdc++-v3 / testsuite / 27_io / manipulators / standard / char / dr2344.cc
CommitLineData
3a99d0de 1// { dg-do run }
2// { dg-options "-std=gnu++14" }
3
f1717362 4// Copyright (C) 2014-2016 Free Software Foundation, Inc.
3a99d0de 5//
6// This file is part of the GNU ISO C++ Library. This library is free
7// software; you can redistribute it and/or modify it under the
8// terms of the GNU General Public License as published by the
9// Free Software Foundation; either version 3, or (at your option)
10// any later version.
11
12// This library is distributed in the hope that it will be useful,
13// but WITHOUT ANY WARRANTY; without even the implied warranty of
14// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15// GNU General Public License for more details.
16
17// You should have received a copy of the GNU General Public License along
18// with this library; see the file COPYING3. If not see
19// <http://www.gnu.org/licenses/>.
20
21// 27.7.6 - Quoted manipulators [quoted.manip]
22
23#include <sstream>
24#include <iomanip>
25#include <testsuite_hooks.h>
26
27void
28test01()
29{
30 bool test [[gnu::unused]] = true;
31
32 std::ostringstream ssx;
33 ssx << "[" << std::left << std::setfill('x') << std::setw(20) << R"("AB \"CD\" EF")" << "]";
34 VERIFY( ssx.str() == R"(["AB \"CD\" EF"xxxxxx])" );
35
36 std::ostringstream ssy;
37 ssy << "[" << std::left << std::setfill('y') << std::setw(20) << std::quoted(R"(GH "IJ" KL)") << "]";
38 VERIFY( ssy.str() == R"(["GH \"IJ\" KL"yyyyyy])" );
39
40 std::ostringstream ssz;
41 ssz << "[" << std::right << std::setfill('z') << std::setw(20) << std::quoted(R"(PQ "RS" TU)") << "]";
42 VERIFY( ssz.str() == R"([zzzzzz"PQ \"RS\" TU"])" );
43}
44
45int
46main()
47{
48 test01();
49 return 0;
50}