Restore Missing awk regex tests. Thanks to dexonsmith for noticing, and proposing this as https://reviews.llvm.org/D16541

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@299652 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Marshall Clow
2017-04-06 14:32:42 +00:00
parent 9a13b433e3
commit de4f6cbb5e

View File

@@ -26,7 +26,7 @@
int main() int main()
{ {
/* { {
std::cmatch m; std::cmatch m;
const char s[] = "a"; const char s[] = "a";
assert(std::regex_match(s, m, std::regex("a", std::regex_constants::awk))); assert(std::regex_match(s, m, std::regex("a", std::regex_constants::awk)));
@@ -616,12 +616,11 @@ int main()
assert(m.size() == 0); assert(m.size() == 0);
} }
std::locale::global(std::locale(LOCALE_cs_CZ_ISO8859_2)); std::locale::global(std::locale(LOCALE_cs_CZ_ISO8859_2));
*/ { {
/*
std::cmatch m; std::cmatch m;
const char s[] = "m"; const char s[] = "m";
assert(std::regex_match(s, m, std::regex("[a[=M=]z]", assert(std::regex_match(s, m,
std::regex_constants::awk); std::regex("[a[=M=]z]", std::regex_constants::awk)));
assert(m.size() == 1); assert(m.size() == 1);
assert(!m.prefix().matched); assert(!m.prefix().matched);
assert(m.prefix().first == s); assert(m.prefix().first == s);
@@ -632,8 +631,8 @@ int main()
assert(m.length(0) == std::char_traits<char>::length(s)); assert(m.length(0) == std::char_traits<char>::length(s));
assert(m.position(0) == 0); assert(m.position(0) == 0);
assert(m.str(0) == s); assert(m.str(0) == s);
*/ } }
/* { {
std::cmatch m; std::cmatch m;
const char s[] = "Ch"; const char s[] = "Ch";
assert(std::regex_match(s, m, std::regex("[a[.ch.]z]", assert(std::regex_match(s, m, std::regex("[a[.ch.]z]",
@@ -1389,4 +1388,4 @@ int main()
assert(m.position(0) == 0); assert(m.position(0) == 0);
assert(m.str(0) == s); assert(m.str(0) == s);
} }
*/} }