From dd426c2fbdcbe066fb0ba4cdf85a7236a54b1522 Mon Sep 17 00:00:00 2001 From: Marshall Clow Date: Thu, 31 Jan 2019 18:54:26 +0000 Subject: Fix a bit of libc++-specific behavior in the regex tests; add a missing test. Reviewed as https://reviews.llvm.org/D57391 Thanks to Andrey Maksimov for the patch llvm-svn: 352781 --- libcxx/test/std/re/re.alg/re.alg.match/exponential.pass.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'libcxx/test/std/re/re.alg/re.alg.match/exponential.pass.cpp') diff --git a/libcxx/test/std/re/re.alg/re.alg.match/exponential.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.match/exponential.pass.cpp index cadbc2cc200..f23bef36ec1 100644 --- a/libcxx/test/std/re/re.alg/re.alg.match/exponential.pass.cpp +++ b/libcxx/test/std/re/re.alg/re.alg.match/exponential.pass.cpp @@ -21,18 +21,20 @@ #include #include +#include "test_macros.h" int main() { for (std::regex_constants::syntax_option_type op : {std::regex::ECMAScript, std::regex::extended, std::regex::egrep, std::regex::awk}) { try { - std::regex_match( + bool b = std::regex_match( "aaaaaaaaaaaaaaaaaaaa", std::regex( "a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?a?aaaaaaaaaaaaaaaaaaaa", op)); - assert(false); + LIBCPP_ASSERT(false); + assert(b); } catch (const std::regex_error &e) { assert(e.code() == std::regex_constants::error_complexity); } -- cgit v1.2.3