Explorar el Código

[libc++] Add yet another test for inverted character classes

This was reported as part of a bug report that ended up being a
duplicate for r340609, but I'm adding the test case since it's
ever so slightly different from what we had before.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@370109 91177308-0d34-0410-b5e6-96231b3b80d8
Louis Dionne hace 6 años
padre
commit
11985b4787

+ 3 - 0
test/std/re/re.alg/re.alg.match/inverted_character_classes.pass.cpp

@@ -53,5 +53,8 @@ int main(int, char**) {
     assert(!std::regex_match("abZcd", std::regex("^ab\\dcd")));
     assert(!std::regex_match("abZcd", std::regex("^ab\\dcd")));
     assert(!std::regex_match("ab5cd", std::regex("^ab\\Dcd")));
     assert(!std::regex_match("ab5cd", std::regex("^ab\\Dcd")));
 
 
+    assert(std::regex_match("_xyz_", std::regex("_(\\s|\\S)+_")));
+    assert(std::regex_match("_xyz_", std::regex("_[\\s\\S]+_")));
+
     return 0;
     return 0;
 }
 }