1 // { dg-do run { target c++11 } }
4 // Copyright (C) 2014-2019 Free Software Foundation, Inc.
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)
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.
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/>.
22 #include <testsuite_hooks.h>
23 #include <testsuite_regex.h>
25 using namespace __gnu_test
;
32 std::setlocale(LC_ALL
, "");
34 std::wstring
current_token(L
"II.");
36 std::vector
<std::wregex
> regex_vector
;
38 for (int i
= 0; i
< 4; ++i
)
40 std::regex_constants::syntax_option_type flag
;
41 flag
= std::regex_constants::ECMAScript
| std::regex_constants::icase
;
44 reg
.imbue(std::locale(""));
45 reg
.assign(L
"^(M*(?:CM|DC{1,3}|D|CD|C{1,3}){0,1}(?:XC|LX{1,3}|L|XL|X{1,3}){0,1}(?:IX|VI{0,3}|IV|I{1,3}){0,1}\\.)$", flag
);
47 regex_vector
.emplace_back(reg
);
50 for (auto cit
= regex_vector
.cbegin(); cit
!= regex_vector
.cend(); ++cit
)
52 std::wstring::const_iterator it1
= current_token
.begin();
53 std::wstring::const_iterator it2
= current_token
.end();
54 std::wsmatch current_token_match
;
56 regex_match_debug(it1
, it2
, current_token_match
, *cit
);
57 VERIFY(current_token_match
[0] == current_token
);
58 VERIFY(current_token_match
[1] == current_token
);