]>
Commit | Line | Data |
---|---|---|
d23d1bee | 1 | // { dg-do run { target c++11 } } |
849cab7b | 2 | |
d2edfb15 | 3 | // 2012-08-20 Benjamin Kosnik <bkoz@redhat.com> |
849cab7b | 4 | // |
a5544970 | 5 | // Copyright (C) 2012-2019 Free Software Foundation, Inc. |
849cab7b SW |
6 | // |
7 | // This file is part of the GNU ISO C++ Library. This library is free | |
8 | // software; you can redistribute it and/or modify it under the | |
9 | // terms of the GNU General Public License as published by the | |
10 | // Free Software Foundation; either version 3, or (at your option) | |
11 | // any later version. | |
12 | // | |
13 | // This library is distributed in the hope that it will be useful, | |
14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | // GNU General Public License for more details. | |
17 | // | |
18 | // You should have received a copy of the GNU General Public License along | |
19 | // with this library; see the file COPYING3. If not see | |
20 | // <http://www.gnu.org/licenses/>. | |
21 | ||
d2edfb15 | 22 | // basic_regex constructors + raw string literals |
849cab7b SW |
23 | |
24 | #include <regex> | |
d2edfb15 | 25 | #include <testsuite_regex.h> |
849cab7b SW |
26 | |
27 | void | |
d2edfb15 BK |
28 | test01() |
29 | { | |
30 | using namespace __gnu_test; | |
31 | ||
32 | // raw string literals | |
33 | ||
f2738d6c | 34 | string_type sre0(R"(\d{3}-\d{3}-\d{4})"); |
d2edfb15 | 35 | |
f2738d6c JW |
36 | string_type sre1(R"( this |
37 | and new : forms | |
38 | )"); | |
d2edfb15 BK |
39 | |
40 | string_type sre2(R"([:num:]{3}-[:num:]{3}-[:num:]{4})"); | |
41 | ||
42 | // 1 | |
f2738d6c JW |
43 | regex_type re0(R"(\d{3}-\d{3}-\d{4})", std::regex::ECMAScript); |
44 | ||
45 | regex_type re1(R"( this | |
46 | and new : forms | |
47 | )", std::regex::basic); | |
48 | ||
49 | regex_type re2(R"([:num:]{3}-[:num:]{3}-[:num:]{4})", std::regex::basic); | |
d2edfb15 BK |
50 | |
51 | // 2 | |
f2738d6c | 52 | regex_sanity_check(sre0, std::regex::ECMAScript); |
d2edfb15 | 53 | regex_sanity_check(sre1); |
f2738d6c | 54 | regex_sanity_check(sre2); |
849cab7b SW |
55 | } |
56 | ||
57 | int main() | |
58 | { | |
59 | test01(); | |
60 | return 0; | |
61 | } |