From 61b9a7258a7693d7f3674a5a1daf7b036ff1d382 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sun, 6 Sep 2015 18:46:46 +0000 Subject: Import libc++ 3.7.0 release (r246257). --- .../re/re.regex/re.regex.construct/string.pass.cpp | 35 ++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 test/std/re/re.regex/re.regex.construct/string.pass.cpp (limited to 'test/std/re/re.regex/re.regex.construct/string.pass.cpp') diff --git a/test/std/re/re.regex/re.regex.construct/string.pass.cpp b/test/std/re/re.regex/re.regex.construct/string.pass.cpp new file mode 100644 index 0000000000000..b58b8e03cd208 --- /dev/null +++ b/test/std/re/re.regex/re.regex.construct/string.pass.cpp @@ -0,0 +1,35 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// + +// template > class basic_regex; + +// template +// basic_regex(const basic_string& s); + +#include +#include + +template +void +test(const String& p, unsigned mc) +{ + std::basic_regex r(p); + assert(r.flags() == std::regex_constants::ECMAScript); + assert(r.mark_count() == mc); +} + +int main() +{ + test(std::string("\\(a\\)"), 0); + test(std::string("\\(a[bc]\\)"), 0); + test(std::string("\\(a\\([bc]\\)\\)"), 0); + test(std::string("(a([bc]))"), 2); +} -- cgit v1.2.3