diff options
author | Louis Dionne <ldionne@apple.com> | 2019-05-30 16:53:05 +0000 |
---|---|---|
committer | Louis Dionne <ldionne@apple.com> | 2019-05-30 16:53:05 +0000 |
commit | ee319034ab8f84f68d9f54425d782e9d080e76c4 (patch) | |
tree | 418324517214f680650a067d3e68f2b6383c98fe /libcxx/test/std/re/re.alg/re.alg.match/inverted_character_classes.pass.cpp | |
parent | 2ae4b3318170e6595bcf652f8b78894213475e53 (diff) | |
download | bcm5719-llvm-ee319034ab8f84f68d9f54425d782e9d080e76c4.tar.gz bcm5719-llvm-ee319034ab8f84f68d9f54425d782e9d080e76c4.zip |
[libcxx] Add regex test cases from PR40904
llvm-svn: 362115
Diffstat (limited to 'libcxx/test/std/re/re.alg/re.alg.match/inverted_character_classes.pass.cpp')
-rw-r--r-- | libcxx/test/std/re/re.alg/re.alg.match/inverted_character_classes.pass.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/libcxx/test/std/re/re.alg/re.alg.match/inverted_character_classes.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.match/inverted_character_classes.pass.cpp index d48d86ee64c..5190357209a 100644 --- a/libcxx/test/std/re/re.alg/re.alg.match/inverted_character_classes.pass.cpp +++ b/libcxx/test/std/re/re.alg/re.alg.match/inverted_character_classes.pass.cpp @@ -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; } |