[libcxx-commits] [libcxx] r362115 - [libcxx] Add regex test cases from PR40904

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Thu May 30 09:53:05 PDT 2019


Author: ldionne
Date: Thu May 30 09:53:05 2019
New Revision: 362115

URL: http://llvm.org/viewvc/llvm-project?rev=362115&view=rev
Log:
[libcxx] Add regex test cases from PR40904

Modified:
    libcxx/trunk/test/std/re/re.alg/re.alg.match/inverted_character_classes.pass.cpp

Modified: libcxx/trunk/test/std/re/re.alg/re.alg.match/inverted_character_classes.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/re/re.alg/re.alg.match/inverted_character_classes.pass.cpp?rev=362115&r1=362114&r2=362115&view=diff
==============================================================================
--- libcxx/trunk/test/std/re/re.alg/re.alg.match/inverted_character_classes.pass.cpp (original)
+++ libcxx/trunk/test/std/re/re.alg/re.alg.match/inverted_character_classes.pass.cpp Thu May 30 09:53:05 2019
@@ -41,5 +41,15 @@ int main(int, char**) {
     assert(std::regex_match("X", std::regex("[^\\W]")));
     assert(std::regex_match("_", std::regex("[^\\W]")));
 
-  return 0;
+    // Those test cases are taken from PR40904
+    assert(std::regex_match("abZcd", std::regex("^ab[\\d\\D]cd")));
+    assert(std::regex_match("ab5cd", std::regex("^ab[\\d\\D]cd")));
+    assert(std::regex_match("abZcd", std::regex("^ab[\\D]cd")));
+    assert(std::regex_match("abZcd", std::regex("^ab\\Dcd")));
+    assert(std::regex_match("ab5cd", std::regex("^ab[\\d]cd")));
+    assert(std::regex_match("ab5cd", std::regex("^ab\\dcd")));
+    assert(!std::regex_match("abZcd", std::regex("^ab\\dcd")));
+    assert(!std::regex_match("ab5cd", std::regex("^ab\\Dcd")));
+
+    return 0;
 }




More information about the libcxx-commits mailing list