]>
Commit | Line | Data |
---|---|---|
61f1ed59 | 1 | // 1999-07-01 bkoz |
b2dad0e3 | 2 | |
61f1ed59 | 3 | // Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. |
b2dad0e3 BK |
4 | // |
5 | // This file is part of the GNU ISO C++ Library. This library is free | |
6 | // software; you can redistribute it and/or modify it under the | |
7 | // terms of the GNU General Public License as published by the | |
8 | // Free Software Foundation; either version 2, or (at your option) | |
9 | // any later version. | |
10 | ||
11 | // This library is distributed in the hope that it will be useful, | |
12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | // GNU General Public License for more details. | |
15 | ||
16 | // You should have received a copy of the GNU General Public License along | |
17 | // with this library; see the file COPYING. If not, write to the Free | |
83f51799 | 18 | // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, |
b2dad0e3 BK |
19 | // USA. |
20 | ||
61f1ed59 PC |
21 | // 21.3.7.9 inserters and extractors |
22 | ||
23 | // NB: This file is predicated on sstreams, istreams, and ostreams | |
24 | // working, not to mention other major details like char_traits, and | |
25 | // all of the string class. | |
b2dad0e3 BK |
26 | |
27 | #include <string> | |
61f1ed59 PC |
28 | #include <sstream> |
29 | #include <iomanip> | |
fe413112 | 30 | #include <testsuite_hooks.h> |
b2dad0e3 | 31 | |
61f1ed59 PC |
32 | // libstdc++/1019 |
33 | void test08() | |
b2dad0e3 | 34 | { |
61f1ed59 | 35 | using namespace std; |
b2dad0e3 | 36 | |
11f10e6b | 37 | bool test __attribute__((unused)) = true; |
61f1ed59 PC |
38 | wistringstream istrm(L"enero:2001"); |
39 | int year; | |
40 | wchar_t sep; | |
41 | wstring month; | |
b2dad0e3 | 42 | |
61f1ed59 PC |
43 | istrm >> setw(5) >> month >> sep >> year; |
44 | VERIFY( month.size() == 5 ); | |
45 | VERIFY( sep == ':' ); | |
46 | VERIFY( year == 2001 ); | |
b2dad0e3 BK |
47 | } |
48 | ||
49 | int main() | |
50 | { | |
61f1ed59 | 51 | test08(); |
04d930e6 | 52 | return 0; |
b2dad0e3 | 53 | } |