diff options
Diffstat (limited to 'libcxx/test/re/re.regex')
29 files changed, 0 insertions, 1067 deletions
diff --git a/libcxx/test/re/re.regex/re.regex.assign/assign.il.pass.cpp b/libcxx/test/re/re.regex/re.regex.assign/assign.il.pass.cpp deleted file mode 100644 index 96cadf16600..00000000000 --- a/libcxx/test/re/re.regex/re.regex.assign/assign.il.pass.cpp +++ /dev/null @@ -1,33 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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. -// -//===----------------------------------------------------------------------===// - -// <regex> - -// template <class charT, class traits = regex_traits<charT>> class basic_regex; - -// basic_regex& -// assign(initializer_list<charT> il, -// flag_type f = regex_constants::ECMAScript); - -#include <regex> -#include <cassert> - -int main() -{ -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS - std::regex r2; - r2.assign({'(', 'a', '(', '[', 'b', 'c', ']', ')', ')'}); - assert(r2.flags() == std::regex::ECMAScript); - assert(r2.mark_count() == 2); - - r2.assign({'(', 'a', '(', '[', 'b', 'c', ']', ')', ')'}, std::regex::extended); - assert(r2.flags() == std::regex::extended); - assert(r2.mark_count() == 2); -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS -} diff --git a/libcxx/test/re/re.regex/re.regex.assign/assign.pass.cpp b/libcxx/test/re/re.regex/re.regex.assign/assign.pass.cpp deleted file mode 100644 index 1bd0022edbc..00000000000 --- a/libcxx/test/re/re.regex/re.regex.assign/assign.pass.cpp +++ /dev/null @@ -1,26 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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. -// -//===----------------------------------------------------------------------===// - -// <regex> - -// template <class charT, class traits = regex_traits<charT>> class basic_regex; - -// basic_regex& assign(const basic_regex& that); - -#include <regex> -#include <cassert> - -int main() -{ - std::regex r1("(a([bc]))"); - std::regex r2; - r2.assign(r1); - assert(r2.flags() == std::regex::ECMAScript); - assert(r2.mark_count() == 2); -} diff --git a/libcxx/test/re/re.regex/re.regex.assign/assign_iter_iter_flag.pass.cpp b/libcxx/test/re/re.regex/re.regex.assign/assign_iter_iter_flag.pass.cpp deleted file mode 100644 index 529a64a239a..00000000000 --- a/libcxx/test/re/re.regex/re.regex.assign/assign_iter_iter_flag.pass.cpp +++ /dev/null @@ -1,46 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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. -// -//===----------------------------------------------------------------------===// - -// <regex> - -// template <class charT, class traits = regex_traits<charT>> class basic_regex; - -// template <class InputIterator> -// basic_regex& -// assign(InputIterator first, InputIterator last, -// flag_type f = regex_constants::ECMAScript); - -#include <regex> -#include <cassert> - -#include "test_iterators.h" - -int main() -{ - typedef input_iterator<std::string::const_iterator> I; - typedef forward_iterator<std::string::const_iterator> F; - std::string s4("(a([bc]))"); - std::regex r2; - - r2.assign(I(s4.begin()), I(s4.end())); - assert(r2.flags() == std::regex::ECMAScript); - assert(r2.mark_count() == 2); - - r2.assign(I(s4.begin()), I(s4.end()), std::regex::extended); - assert(r2.flags() == std::regex::extended); - assert(r2.mark_count() == 2); - - r2.assign(F(s4.begin()), F(s4.end())); - assert(r2.flags() == std::regex::ECMAScript); - assert(r2.mark_count() == 2); - - r2.assign(F(s4.begin()), F(s4.end()), std::regex::extended); - assert(r2.flags() == std::regex::extended); - assert(r2.mark_count() == 2); -} diff --git a/libcxx/test/re/re.regex/re.regex.assign/assign_ptr_flag.pass.cpp b/libcxx/test/re/re.regex/re.regex.assign/assign_ptr_flag.pass.cpp deleted file mode 100644 index dd39dee13ff..00000000000 --- a/libcxx/test/re/re.regex/re.regex.assign/assign_ptr_flag.pass.cpp +++ /dev/null @@ -1,29 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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. -// -//===----------------------------------------------------------------------===// - -// <regex> - -// template <class charT, class traits = regex_traits<charT>> class basic_regex; - -// basic_regex& assign(const charT* ptr, flag_type f = regex_constants::ECMAScript); - -#include <regex> -#include <cassert> - -int main() -{ - std::regex r2; - r2.assign("(a([bc]))"); - assert(r2.flags() == std::regex::ECMAScript); - assert(r2.mark_count() == 2); - - r2.assign("(a([bc]))", std::regex::extended); - assert(r2.flags() == std::regex::extended); - assert(r2.mark_count() == 2); -} diff --git a/libcxx/test/re/re.regex/re.regex.assign/assign_ptr_size_flag.pass.cpp b/libcxx/test/re/re.regex/re.regex.assign/assign_ptr_size_flag.pass.cpp deleted file mode 100644 index 679cd9df17f..00000000000 --- a/libcxx/test/re/re.regex/re.regex.assign/assign_ptr_size_flag.pass.cpp +++ /dev/null @@ -1,25 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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. -// -//===----------------------------------------------------------------------===// - -// <regex> - -// template <class charT, class traits = regex_traits<charT>> class basic_regex; - -// basic_regex& assign(const charT* ptr, size_t len, flag_type f); - -#include <regex> -#include <cassert> - -int main() -{ - std::regex r2; - r2.assign("(a([bc]))", 9, std::regex::extended); - assert(r2.flags() == std::regex::extended); - assert(r2.mark_count() == 2); -} diff --git a/libcxx/test/re/re.regex/re.regex.assign/assign_string_flag.pass.cpp b/libcxx/test/re/re.regex/re.regex.assign/assign_string_flag.pass.cpp deleted file mode 100644 index 46f984da04d..00000000000 --- a/libcxx/test/re/re.regex/re.regex.assign/assign_string_flag.pass.cpp +++ /dev/null @@ -1,31 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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. -// -//===----------------------------------------------------------------------===// - -// <regex> - -// template <class charT, class traits = regex_traits<charT>> class basic_regex; - -// template <class string_traits, class A> -// basic_regex& assign(const basic_string<charT, string_traits, A>& s, -// flag_type f = regex_constants::ECMAScript); - -#include <regex> -#include <cassert> - -int main() -{ - std::regex r2; - r2.assign(std::string("(a([bc]))")); - assert(r2.flags() == std::regex::ECMAScript); - assert(r2.mark_count() == 2); - - r2.assign(std::string("(a([bc]))"), std::regex::extended); - assert(r2.flags() == std::regex::extended); - assert(r2.mark_count() == 2); -} diff --git a/libcxx/test/re/re.regex/re.regex.assign/copy.pass.cpp b/libcxx/test/re/re.regex/re.regex.assign/copy.pass.cpp deleted file mode 100644 index 2a616ff012c..00000000000 --- a/libcxx/test/re/re.regex/re.regex.assign/copy.pass.cpp +++ /dev/null @@ -1,26 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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. -// -//===----------------------------------------------------------------------===// - -// <regex> - -// template <class charT, class traits = regex_traits<charT>> class basic_regex; - -// basic_regex& operator=(const basic_regex& e); - -#include <regex> -#include <cassert> - -int main() -{ - std::regex r1("(a([bc]))"); - std::regex r2; - r2 = r1; - assert(r2.flags() == std::regex::ECMAScript); - assert(r2.mark_count() == 2); -} diff --git a/libcxx/test/re/re.regex/re.regex.assign/il.pass.cpp b/libcxx/test/re/re.regex/re.regex.assign/il.pass.cpp deleted file mode 100644 index a9d8ada4ff0..00000000000 --- a/libcxx/test/re/re.regex/re.regex.assign/il.pass.cpp +++ /dev/null @@ -1,27 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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. -// -//===----------------------------------------------------------------------===// - -// <regex> - -// template <class charT, class traits = regex_traits<charT>> class basic_regex; - -// basic_regex& operator=(initializer_list<charT> il); - -#include <regex> -#include <cassert> - -int main() -{ -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS - std::regex r2; - r2 = {'(', 'a', '(', '[', 'b', 'c', ']', ')', ')'}; - assert(r2.flags() == std::regex::ECMAScript); - assert(r2.mark_count() == 2); -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS -} diff --git a/libcxx/test/re/re.regex/re.regex.assign/ptr.pass.cpp b/libcxx/test/re/re.regex/re.regex.assign/ptr.pass.cpp deleted file mode 100644 index 4c42f822a1e..00000000000 --- a/libcxx/test/re/re.regex/re.regex.assign/ptr.pass.cpp +++ /dev/null @@ -1,25 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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. -// -//===----------------------------------------------------------------------===// - -// <regex> - -// template <class charT, class traits = regex_traits<charT>> class basic_regex; - -// basic_regex& operator=(const charT* ptr); - -#include <regex> -#include <cassert> - -int main() -{ - std::regex r2; - r2 = "(a([bc]))"; - assert(r2.flags() == std::regex::ECMAScript); - assert(r2.mark_count() == 2); -} diff --git a/libcxx/test/re/re.regex/re.regex.assign/string.pass.cpp b/libcxx/test/re/re.regex/re.regex.assign/string.pass.cpp deleted file mode 100644 index 7f09e5364ac..00000000000 --- a/libcxx/test/re/re.regex/re.regex.assign/string.pass.cpp +++ /dev/null @@ -1,26 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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. -// -//===----------------------------------------------------------------------===// - -// <regex> - -// template <class charT, class traits = regex_traits<charT>> class basic_regex; - -// template <class ST, class SA> -// basic_regex& operator=(const basic_string<charT, ST, SA>& p); - -#include <regex> -#include <cassert> - -int main() -{ - std::regex r2; - r2 = std::string("(a([bc]))"); - assert(r2.flags() == std::regex::ECMAScript); - assert(r2.mark_count() == 2); -} diff --git a/libcxx/test/re/re.regex/re.regex.const/constants.pass.cpp b/libcxx/test/re/re.regex/re.regex.const/constants.pass.cpp deleted file mode 100644 index 85297b91f43..00000000000 --- a/libcxx/test/re/re.regex/re.regex.const/constants.pass.cpp +++ /dev/null @@ -1,65 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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. -// -//===----------------------------------------------------------------------===// - -// <regex> - -// template <class charT, class traits = regex_traits<charT>> -// class basic_regex -// { -// public: -// // constants: -// static constexpr regex_constants::syntax_option_type icase = regex_constants::icase; -// static constexpr regex_constants::syntax_option_type nosubs = regex_constants::nosubs; -// static constexpr regex_constants::syntax_option_type optimize = regex_constants::optimize; -// static constexpr regex_constants::syntax_option_type collate = regex_constants::collate; -// static constexpr regex_constants::syntax_option_type ECMAScript = regex_constants::ECMAScript; -// static constexpr regex_constants::syntax_option_type basic = regex_constants::basic; -// static constexpr regex_constants::syntax_option_type extended = regex_constants::extended; -// static constexpr regex_constants::syntax_option_type awk = regex_constants::awk; -// static constexpr regex_constants::syntax_option_type grep = regex_constants::grep; -// static constexpr regex_constants::syntax_option_type egrep = regex_constants::egrep; - -#include <regex> -#include <type_traits> - -template <class _Tp> -void where(const _Tp &) {} - -template <class CharT> -void -test() -{ - typedef std::basic_regex<CharT> BR; - static_assert((BR::icase == std::regex_constants::icase), ""); - static_assert((BR::nosubs == std::regex_constants::nosubs), ""); - static_assert((BR::optimize == std::regex_constants::optimize), ""); - static_assert((BR::collate == std::regex_constants::collate), ""); - static_assert((BR::ECMAScript == std::regex_constants::ECMAScript), ""); - static_assert((BR::basic == std::regex_constants::basic), ""); - static_assert((BR::extended == std::regex_constants::extended), ""); - static_assert((BR::awk == std::regex_constants::awk), ""); - static_assert((BR::grep == std::regex_constants::grep), ""); - static_assert((BR::egrep == std::regex_constants::egrep), ""); - where(BR::icase); - where(BR::nosubs); - where(BR::optimize); - where(BR::collate); - where(BR::ECMAScript); - where(BR::basic); - where(BR::extended); - where(BR::awk); - where(BR::grep); - where(BR::egrep); -} - -int main() -{ - test<char>(); - test<wchar_t>(); -} diff --git a/libcxx/test/re/re.regex/re.regex.construct/awk_oct.pass.cpp b/libcxx/test/re/re.regex/re.regex.construct/awk_oct.pass.cpp deleted file mode 100644 index 4b7e5e62929..00000000000 --- a/libcxx/test/re/re.regex/re.regex.construct/awk_oct.pass.cpp +++ /dev/null @@ -1,28 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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. -// -//===----------------------------------------------------------------------===// - -// <regex> - -// template <class charT, class traits = regex_traits<charT>> class basic_regex; - -// template <class ST, class SA> -// basic_regex(const basic_string<charT, ST, SA>& s); - -#include <regex> -#include <cassert> - -int main() -{ - using std::regex_constants::awk; - - assert(std::regex_match("\4", std::regex("\\4", awk))); - assert(std::regex_match("\41", std::regex("\\41", awk))); - assert(std::regex_match("\141", std::regex("\\141", awk))); - assert(std::regex_match("\1411", std::regex("\\1411", awk))); -} diff --git a/libcxx/test/re/re.regex/re.regex.construct/bad_escape.pass.cpp b/libcxx/test/re/re.regex/re.regex.construct/bad_escape.pass.cpp deleted file mode 100644 index 9455527412b..00000000000 --- a/libcxx/test/re/re.regex/re.regex.construct/bad_escape.pass.cpp +++ /dev/null @@ -1,45 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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. -// -//===----------------------------------------------------------------------===// - -// <regex> - -// template <class charT, class traits = regex_traits<charT>> class basic_regex; - -// template <class ST, class SA> -// basic_regex(const basic_string<charT, ST, SA>& s); - -#include <regex> -#include <cassert> - -static bool error_escape_thrown(const char *pat) -{ - bool result = false; - try { - std::regex re(pat); - } catch (std::regex_error &ex) { - result = (ex.code() == std::regex_constants::error_escape); - } - return result; -} - -int main() -{ - assert(error_escape_thrown("[\\a]")); - assert(error_escape_thrown("\\a")); - - assert(error_escape_thrown("[\\e]")); - assert(error_escape_thrown("\\e")); - - assert(error_escape_thrown("[\\c:]")); - assert(error_escape_thrown("\\c:")); - assert(error_escape_thrown("\\c")); - assert(!error_escape_thrown("[\\cA]")); - assert(!error_escape_thrown("\\cA")); - -} diff --git a/libcxx/test/re/re.regex/re.regex.construct/copy.pass.cpp b/libcxx/test/re/re.regex/re.regex.construct/copy.pass.cpp deleted file mode 100644 index c2788f0fa2c..00000000000 --- a/libcxx/test/re/re.regex/re.regex.construct/copy.pass.cpp +++ /dev/null @@ -1,25 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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. -// -//===----------------------------------------------------------------------===// - -// <regex> - -// template <class charT, class traits = regex_traits<charT>> class basic_regex; - -// basic_regex(const basic_regex& e); - -#include <regex> -#include <cassert> - -int main() -{ - std::regex r1("(a([bc]))"); - std::regex r2 = r1; - assert(r2.flags() == std::regex::ECMAScript); - assert(r2.mark_count() == 2); -} diff --git a/libcxx/test/re/re.regex/re.regex.construct/default.pass.cpp b/libcxx/test/re/re.regex/re.regex.construct/default.pass.cpp deleted file mode 100644 index d959c1ec582..00000000000 --- a/libcxx/test/re/re.regex/re.regex.construct/default.pass.cpp +++ /dev/null @@ -1,32 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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. -// -//===----------------------------------------------------------------------===// - -// <regex> - -// template <class charT, class traits = regex_traits<charT>> class basic_regex; - -// basic_regex(); - -#include <regex> -#include <cassert> - -template <class CharT> -void -test() -{ - std::basic_regex<CharT> r; - assert(r.flags() == 0); - assert(r.mark_count() == 0); -} - -int main() -{ - test<char>(); - test<wchar_t>(); -} diff --git a/libcxx/test/re/re.regex/re.regex.construct/il_flg.pass.cpp b/libcxx/test/re/re.regex/re.regex.construct/il_flg.pass.cpp deleted file mode 100644 index 70d28df370d..00000000000 --- a/libcxx/test/re/re.regex/re.regex.construct/il_flg.pass.cpp +++ /dev/null @@ -1,70 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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. -// -//===----------------------------------------------------------------------===// - -// <regex> - -// template <class charT, class traits = regex_traits<charT>> class basic_regex; - -// basic_regex(initializer_list<charT> il, -// flag_type f = regex_constants::ECMAScript); - -#include <regex> -#include <cassert> - -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS - -void -test(std::initializer_list<char> il, std::regex_constants::syntax_option_type f, unsigned mc) -{ - std::basic_regex<char> r(il, f); - assert(r.flags() == f); - assert(r.mark_count() == mc); -} - -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS - -int main() -{ -#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS - std::string s1("\\(a\\)"); - std::string s2("\\(a[bc]\\)"); - std::string s3("\\(a\\([bc]\\)\\)"); - std::string s4("(a([bc]))"); - - test({'\\', '(', 'a', '\\', ')'}, std::regex_constants::basic, 1); - test({'\\', '(', 'a', '[', 'b', 'c', ']', '\\', ')'}, std::regex_constants::basic, 1); - test({'\\', '(', 'a', '\\', '(', '[', 'b', 'c', ']', '\\', ')', '\\', ')'}, std::regex_constants::basic, 2); - test({'(', 'a', '(', '[', 'b', 'c', ']', ')', ')'}, std::regex_constants::basic, 0); - - test({'\\', '(', 'a', '\\', ')'}, std::regex_constants::extended, 0); - test({'\\', '(', 'a', '[', 'b', 'c', ']', '\\', ')'}, std::regex_constants::extended, 0); - test({'\\', '(', 'a', '\\', '(', '[', 'b', 'c', ']', '\\', ')', '\\', ')'}, std::regex_constants::extended, 0); - test({'(', 'a', '(', '[', 'b', 'c', ']', ')', ')'}, std::regex_constants::extended, 2); - - test({'\\', '(', 'a', '\\', ')'}, std::regex_constants::ECMAScript, 0); - test({'\\', '(', 'a', '[', 'b', 'c', ']', '\\', ')'}, std::regex_constants::ECMAScript, 0); - test({'\\', '(', 'a', '\\', '(', '[', 'b', 'c', ']', '\\', ')', '\\', ')'}, std::regex_constants::ECMAScript, 0); - test({'(', 'a', '(', '[', 'b', 'c', ']', ')', ')'}, std::regex_constants::ECMAScript, 2); - - test({'\\', '(', 'a', '\\', ')'}, std::regex_constants::awk, 0); - test({'\\', '(', 'a', '[', 'b', 'c', ']', '\\', ')'}, std::regex_constants::awk, 0); - test({'\\', '(', 'a', '\\', '(', '[', 'b', 'c', ']', '\\', ')', '\\', ')'}, std::regex_constants::awk, 0); - test({'(', 'a', '(', '[', 'b', 'c', ']', ')', ')'}, std::regex_constants::awk, 2); - - test({'\\', '(', 'a', '\\', ')'}, std::regex_constants::grep, 1); - test({'\\', '(', 'a', '[', 'b', 'c', ']', '\\', ')'}, std::regex_constants::grep, 1); - test({'\\', '(', 'a', '\\', '(', '[', 'b', 'c', ']', '\\', ')', '\\', ')'}, std::regex_constants::grep, 2); - test({'(', 'a', '(', '[', 'b', 'c', ']', ')', ')'}, std::regex_constants::grep, 0); - - test({'\\', '(', 'a', '\\', ')'}, std::regex_constants::egrep, 0); - test({'\\', '(', 'a', '[', 'b', 'c', ']', '\\', ')'}, std::regex_constants::egrep, 0); - test({'\\', '(', 'a', '\\', '(', '[', 'b', 'c', ']', '\\', ')', '\\', ')'}, std::regex_constants::egrep, 0); - test({'(', 'a', '(', '[', 'b', 'c', ']', ')', ')'}, std::regex_constants::egrep, 2); -#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS -} diff --git a/libcxx/test/re/re.regex/re.regex.construct/iter_iter.pass.cpp b/libcxx/test/re/re.regex/re.regex.construct/iter_iter.pass.cpp deleted file mode 100644 index a38e1623419..00000000000 --- a/libcxx/test/re/re.regex/re.regex.construct/iter_iter.pass.cpp +++ /dev/null @@ -1,43 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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. -// -//===----------------------------------------------------------------------===// - -// <regex> - -// template <class charT, class traits = regex_traits<charT>> class basic_regex; - -// template <class ForwardIterator> -// basic_regex(ForwardIterator first, ForwardIterator last); - -#include <regex> -#include <cassert> - -#include "test_iterators.h" - -template <class Iter> -void -test(Iter first, Iter last, unsigned mc) -{ - std::basic_regex<typename std::iterator_traits<Iter>::value_type> r(first, last); - assert(r.flags() == std::regex_constants::ECMAScript); - assert(r.mark_count() == mc); -} - -int main() -{ - typedef forward_iterator<std::string::const_iterator> F; - std::string s1("\\(a\\)"); - std::string s2("\\(a[bc]\\)"); - std::string s3("\\(a\\([bc]\\)\\)"); - std::string s4("(a([bc]))"); - - test(F(s1.begin()), F(s1.end()), 0); - test(F(s2.begin()), F(s2.end()), 0); - test(F(s3.begin()), F(s3.end()), 0); - test(F(s4.begin()), F(s4.end()), 2); -} diff --git a/libcxx/test/re/re.regex/re.regex.construct/iter_iter_flg.pass.cpp b/libcxx/test/re/re.regex/re.regex.construct/iter_iter_flg.pass.cpp deleted file mode 100644 index c4c440e6d24..00000000000 --- a/libcxx/test/re/re.regex/re.regex.construct/iter_iter_flg.pass.cpp +++ /dev/null @@ -1,69 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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. -// -//===----------------------------------------------------------------------===// - -// <regex> - -// template <class charT, class traits = regex_traits<charT>> class basic_regex; - -// template <class ForwardIterator> -// basic_regex(ForwardIterator first, ForwardIterator last, -// flag_type f = regex_constants::ECMAScript); - -#include <regex> -#include <cassert> - -#include "test_iterators.h" - -template <class Iter> -void -test(Iter first, Iter last, std::regex_constants::syntax_option_type f, unsigned mc) -{ - std::basic_regex<typename std::iterator_traits<Iter>::value_type> r(first, last, f); - assert(r.flags() == f); - assert(r.mark_count() == mc); -} - -int main() -{ - typedef forward_iterator<std::string::const_iterator> F; - std::string s1("\\(a\\)"); - std::string s2("\\(a[bc]\\)"); - std::string s3("\\(a\\([bc]\\)\\)"); - std::string s4("(a([bc]))"); - - test(F(s1.begin()), F(s1.end()), std::regex_constants::basic, 1); - test(F(s2.begin()), F(s2.end()), std::regex_constants::basic, 1); - test(F(s3.begin()), F(s3.end()), std::regex_constants::basic, 2); - test(F(s4.begin()), F(s4.end()), std::regex_constants::basic, 0); - - test(F(s1.begin()), F(s1.end()), std::regex_constants::extended, 0); - test(F(s2.begin()), F(s2.end()), std::regex_constants::extended, 0); - test(F(s3.begin()), F(s3.end()), std::regex_constants::extended, 0); - test(F(s4.begin()), F(s4.end()), std::regex_constants::extended, 2); - - test(F(s1.begin()), F(s1.end()), std::regex_constants::ECMAScript, 0); - test(F(s2.begin()), F(s2.end()), std::regex_constants::ECMAScript, 0); - test(F(s3.begin()), F(s3.end()), std::regex_constants::ECMAScript, 0); - test(F(s4.begin()), F(s4.end()), std::regex_constants::ECMAScript, 2); - - test(F(s1.begin()), F(s1.end()), std::regex_constants::awk, 0); - test(F(s2.begin()), F(s2.end()), std::regex_constants::awk, 0); - test(F(s3.begin()), F(s3.end()), std::regex_constants::awk, 0); - test(F(s4.begin()), F(s4.end()), std::regex_constants::awk, 2); - - test(F(s1.begin()), F(s1.end()), std::regex_constants::grep, 1); - test(F(s2.begin()), F(s2.end()), std::regex_constants::grep, 1); - test(F(s3.begin()), F(s3.end()), std::regex_constants::grep, 2); - test(F(s4.begin()), F(s4.end()), std::regex_constants::grep, 0); - - test(F(s1.begin()), F(s1.end()), std::regex_constants::egrep, 0); - test(F(s2.begin()), F(s2.end()), std::regex_constants::egrep, 0); - test(F(s3.begin()), F(s3.end()), std::regex_constants::egrep, 0); - test(F(s4.begin()), F(s4.end()), std::regex_constants::egrep, 2); -} diff --git a/libcxx/test/re/re.regex/re.regex.construct/ptr.pass.cpp b/libcxx/test/re/re.regex/re.regex.construct/ptr.pass.cpp deleted file mode 100644 index b99b58b469c..00000000000 --- a/libcxx/test/re/re.regex/re.regex.construct/ptr.pass.cpp +++ /dev/null @@ -1,34 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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. -// -//===----------------------------------------------------------------------===// - -// <regex> - -// template <class charT, class traits = regex_traits<charT>> class basic_regex; - -// basic_regex(const charT* p); - -#include <regex> -#include <cassert> - -template <class CharT> -void -test(const CharT* p, unsigned mc) -{ - std::basic_regex<CharT> r(p); - assert(r.flags() == std::regex_constants::ECMAScript); - assert(r.mark_count() == mc); -} - -int main() -{ - test("\\(a\\)", 0); - test("\\(a[bc]\\)", 0); - test("\\(a\\([bc]\\)\\)", 0); - test("(a([bc]))", 2); -} diff --git a/libcxx/test/re/re.regex/re.regex.construct/ptr_flg.pass.cpp b/libcxx/test/re/re.regex/re.regex.construct/ptr_flg.pass.cpp deleted file mode 100644 index 138e20efbf6..00000000000 --- a/libcxx/test/re/re.regex/re.regex.construct/ptr_flg.pass.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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. -// -//===----------------------------------------------------------------------===// - -// <regex> - -// template <class charT, class traits = regex_traits<charT>> class basic_regex; - -// basic_regex(const charT* p, flag_type f = regex_constants::ECMAScript); - -#include <regex> -#include <cassert> - -template <class CharT> -void -test(const CharT* p, std::regex_constants::syntax_option_type f, unsigned mc) -{ - std::basic_regex<CharT> r(p, f); - assert(r.flags() == f); - assert(r.mark_count() == mc); -} - -int main() -{ - test("\\(a\\)", std::regex_constants::basic, 1); - test("\\(a[bc]\\)", std::regex_constants::basic, 1); - test("\\(a\\([bc]\\)\\)", std::regex_constants::basic, 2); - test("(a([bc]))", std::regex_constants::basic, 0); - - test("\\(a\\)", std::regex_constants::extended, 0); - test("\\(a[bc]\\)", std::regex_constants::extended, 0); - test("\\(a\\([bc]\\)\\)", std::regex_constants::extended, 0); - test("(a([bc]))", std::regex_constants::extended, 2); - - test("\\(a\\)", std::regex_constants::ECMAScript, 0); - test("\\(a[bc]\\)", std::regex_constants::ECMAScript, 0); - test("\\(a\\([bc]\\)\\)", std::regex_constants::ECMAScript, 0); - test("(a([bc]))", std::regex_constants::ECMAScript, 2); - - test("\\(a\\)", std::regex_constants::awk, 0); - test("\\(a[bc]\\)", std::regex_constants::awk, 0); - test("\\(a\\([bc]\\)\\)", std::regex_constants::awk, 0); - test("(a([bc]))", std::regex_constants::awk, 2); - - test("\\(a\\)", std::regex_constants::grep, 1); - test("\\(a[bc]\\)", std::regex_constants::grep, 1); - test("\\(a\\([bc]\\)\\)", std::regex_constants::grep, 2); - test("(a([bc]))", std::regex_constants::grep, 0); - - test("\\(a\\)", std::regex_constants::egrep, 0); - test("\\(a[bc]\\)", std::regex_constants::egrep, 0); - test("\\(a\\([bc]\\)\\)", std::regex_constants::egrep, 0); - test("(a([bc]))", std::regex_constants::egrep, 2); -} diff --git a/libcxx/test/re/re.regex/re.regex.construct/ptr_size_flg.pass.cpp b/libcxx/test/re/re.regex/re.regex.construct/ptr_size_flg.pass.cpp deleted file mode 100644 index d623a15936f..00000000000 --- a/libcxx/test/re/re.regex/re.regex.construct/ptr_size_flg.pass.cpp +++ /dev/null @@ -1,60 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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. -// -//===----------------------------------------------------------------------===// - -// <regex> - -// template <class charT, class traits = regex_traits<charT>> class basic_regex; - -// basic_regex(const charT* p, size_t len, flag_type f); - -#include <regex> -#include <cassert> - -template <class CharT> -void -test(const CharT* p, std::size_t len, std::regex_constants::syntax_option_type f, - unsigned mc) -{ - std::basic_regex<CharT> r(p, len, f); - assert(r.flags() == f); - assert(r.mark_count() == mc); -} - -int main() -{ - test("\\(a\\)", 5, std::regex_constants::basic, 1); - test("\\(a[bc]\\)", 9, std::regex_constants::basic, 1); - test("\\(a\\([bc]\\)\\)", 13, std::regex_constants::basic, 2); - test("(a([bc]))", 9, std::regex_constants::basic, 0); - - test("\\(a\\)", 5, std::regex_constants::extended, 0); - test("\\(a[bc]\\)", 9, std::regex_constants::extended, 0); - test("\\(a\\([bc]\\)\\)", 13, std::regex_constants::extended, 0); - test("(a([bc]))", 9, std::regex_constants::extended, 2); - - test("\\(a\\)", 5, std::regex_constants::ECMAScript, 0); - test("\\(a[bc]\\)", 9, std::regex_constants::ECMAScript, 0); - test("\\(a\\([bc]\\)\\)", 13, std::regex_constants::ECMAScript, 0); - test("(a([bc]))", 9, std::regex_constants::ECMAScript, 2); - - test("\\(a\\)", 5, std::regex_constants::awk, 0); - test("\\(a[bc]\\)", 9, std::regex_constants::awk, 0); - test("\\(a\\([bc]\\)\\)", 13, std::regex_constants::awk, 0); - test("(a([bc]))", 9, std::regex_constants::awk, 2); - - test("\\(a\\)", 5, std::regex_constants::grep, 1); - test("\\(a[bc]\\)", 9, std::regex_constants::grep, 1); - test("\\(a\\([bc]\\)\\)", 13, std::regex_constants::grep, 2); - test("(a([bc]))", 9, std::regex_constants::grep, 0); - - test("\\(a\\)", 5, std::regex_constants::egrep, 0); - test("\\(a[bc]\\)", 9, std::regex_constants::egrep, 0); - test("\\(a\\([bc]\\)\\)", 13, std::regex_constants::egrep, 0); - test("(a([bc]))", 9, std::regex_constants::egrep, 2); -} diff --git a/libcxx/test/re/re.regex/re.regex.construct/string.pass.cpp b/libcxx/test/re/re.regex/re.regex.construct/string.pass.cpp deleted file mode 100644 index b58b8e03cd2..00000000000 --- a/libcxx/test/re/re.regex/re.regex.construct/string.pass.cpp +++ /dev/null @@ -1,35 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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. -// -//===----------------------------------------------------------------------===// - -// <regex> - -// template <class charT, class traits = regex_traits<charT>> class basic_regex; - -// template <class ST, class SA> -// basic_regex(const basic_string<charT, ST, SA>& s); - -#include <regex> -#include <cassert> - -template <class String> -void -test(const String& p, unsigned mc) -{ - std::basic_regex<typename String::value_type> 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); -} diff --git a/libcxx/test/re/re.regex/re.regex.construct/string_flg.pass.cpp b/libcxx/test/re/re.regex/re.regex.construct/string_flg.pass.cpp deleted file mode 100644 index 768de568e22..00000000000 --- a/libcxx/test/re/re.regex/re.regex.construct/string_flg.pass.cpp +++ /dev/null @@ -1,61 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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. -// -//===----------------------------------------------------------------------===// - -// <regex> - -// template <class charT, class traits = regex_traits<charT>> class basic_regex; - -// template <class ST, class SA> -// basic_regex(const basic_string<charT, ST, SA>& s, -// flag_type f = regex_constants::ECMAScript); - -#include <regex> -#include <cassert> - -template <class String> -void -test(const String& p, std::regex_constants::syntax_option_type f, unsigned mc) -{ - std::basic_regex<typename String::value_type> r(p, f); - assert(r.flags() == f); - assert(r.mark_count() == mc); -} - -int main() -{ - test(std::string("\\(a\\)"), std::regex_constants::basic, 1); - test(std::string("\\(a[bc]\\)"), std::regex_constants::basic, 1); - test(std::string("\\(a\\([bc]\\)\\)"), std::regex_constants::basic, 2); - test(std::string("(a([bc]))"), std::regex_constants::basic, 0); - - test(std::string("\\(a\\)"), std::regex_constants::extended, 0); - test(std::string("\\(a[bc]\\)"), std::regex_constants::extended, 0); - test(std::string("\\(a\\([bc]\\)\\)"), std::regex_constants::extended, 0); - test(std::string("(a([bc]))"), std::regex_constants::extended, 2); - - test(std::string("\\(a\\)"), std::regex_constants::ECMAScript, 0); - test(std::string("\\(a[bc]\\)"), std::regex_constants::ECMAScript, 0); - test(std::string("\\(a\\([bc]\\)\\)"), std::regex_constants::ECMAScript, 0); - test(std::string("(a([bc]))"), std::regex_constants::ECMAScript, 2); - - test(std::string("\\(a\\)"), std::regex_constants::awk, 0); - test(std::string("\\(a[bc]\\)"), std::regex_constants::awk, 0); - test(std::string("\\(a\\([bc]\\)\\)"), std::regex_constants::awk, 0); - test(std::string("(a([bc]))"), std::regex_constants::awk, 2); - - test(std::string("\\(a\\)"), std::regex_constants::grep, 1); - test(std::string("\\(a[bc]\\)"), std::regex_constants::grep, 1); - test(std::string("\\(a\\([bc]\\)\\)"), std::regex_constants::grep, 2); - test(std::string("(a([bc]))"), std::regex_constants::grep, 0); - - test(std::string("\\(a\\)"), std::regex_constants::egrep, 0); - test(std::string("\\(a[bc]\\)"), std::regex_constants::egrep, 0); - test(std::string("\\(a\\([bc]\\)\\)"), std::regex_constants::egrep, 0); - test(std::string("(a([bc]))"), std::regex_constants::egrep, 2); -} diff --git a/libcxx/test/re/re.regex/re.regex.locale/imbue.pass.cpp b/libcxx/test/re/re.regex/re.regex.locale/imbue.pass.cpp deleted file mode 100644 index be0b26dc5c2..00000000000 --- a/libcxx/test/re/re.regex/re.regex.locale/imbue.pass.cpp +++ /dev/null @@ -1,31 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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. -// -//===----------------------------------------------------------------------===// - -// <regex> - -// template <class charT, class traits = regex_traits<charT>> class basic_regex; - -// locale_type imbue(locale_type loc); - -#include <regex> -#include <locale> -#include <cassert> - -#include "platform_support.h" // locale name macros - -int main() -{ - std::regex r; - std::locale loc = r.imbue(std::locale(LOCALE_en_US_UTF_8)); - assert(loc.name() == "C"); - assert(r.getloc().name() == LOCALE_en_US_UTF_8); - loc = r.imbue(std::locale("C")); - assert(loc.name() == LOCALE_en_US_UTF_8); - assert(r.getloc().name() == "C"); -} diff --git a/libcxx/test/re/re.regex/re.regex.nonmemb/nothing_to_do.pass.cpp b/libcxx/test/re/re.regex/re.regex.nonmemb/nothing_to_do.pass.cpp deleted file mode 100644 index b58f5c55b64..00000000000 --- a/libcxx/test/re/re.regex/re.regex.nonmemb/nothing_to_do.pass.cpp +++ /dev/null @@ -1,12 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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. -// -//===----------------------------------------------------------------------===// - -int main() -{ -} diff --git a/libcxx/test/re/re.regex/re.regex.nonmemb/re.regex.nmswap/swap.pass.cpp b/libcxx/test/re/re.regex/re.regex.nonmemb/re.regex.nmswap/swap.pass.cpp deleted file mode 100644 index 9d3c481686e..00000000000 --- a/libcxx/test/re/re.regex/re.regex.nonmemb/re.regex.nmswap/swap.pass.cpp +++ /dev/null @@ -1,29 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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. -// -//===----------------------------------------------------------------------===// - -// <regex> - -// template <class charT, class traits = regex_traits<charT>> class basic_regex; - -// template <class charT, class traits> -// void swap(basic_regex<charT, traits>& lhs, basic_regex<charT, traits>& rhs); - -#include <regex> -#include <cassert> - -int main() -{ - std::regex r1("(a([bc]))"); - std::regex r2; - swap(r2, r1); - assert(r1.flags() == std::regex::ECMAScript); - assert(r1.mark_count() == 0); - assert(r2.flags() == std::regex::ECMAScript); - assert(r2.mark_count() == 2); -} diff --git a/libcxx/test/re/re.regex/re.regex.operations/tested_elsewhere.pass.cpp b/libcxx/test/re/re.regex/re.regex.operations/tested_elsewhere.pass.cpp deleted file mode 100644 index b58f5c55b64..00000000000 --- a/libcxx/test/re/re.regex/re.regex.operations/tested_elsewhere.pass.cpp +++ /dev/null @@ -1,12 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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. -// -//===----------------------------------------------------------------------===// - -int main() -{ -} diff --git a/libcxx/test/re/re.regex/re.regex.swap/swap.pass.cpp b/libcxx/test/re/re.regex/re.regex.swap/swap.pass.cpp deleted file mode 100644 index cda8ef3541a..00000000000 --- a/libcxx/test/re/re.regex/re.regex.swap/swap.pass.cpp +++ /dev/null @@ -1,28 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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. -// -//===----------------------------------------------------------------------===// - -// <regex> - -// template <class charT, class traits = regex_traits<charT>> class basic_regex; - -// void swap(basic_regex& e); - -#include <regex> -#include <cassert> - -int main() -{ - std::regex r1("(a([bc]))"); - std::regex r2; - r2.swap(r1); - assert(r1.flags() == std::regex::ECMAScript); - assert(r1.mark_count() == 0); - assert(r2.flags() == std::regex::ECMAScript); - assert(r2.mark_count() == 2); -} diff --git a/libcxx/test/re/re.regex/types.pass.cpp b/libcxx/test/re/re.regex/types.pass.cpp deleted file mode 100644 index 02011ac56eb..00000000000 --- a/libcxx/test/re/re.regex/types.pass.cpp +++ /dev/null @@ -1,35 +0,0 @@ -//===----------------------------------------------------------------------===// -// -// 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. -// -//===----------------------------------------------------------------------===// - -// <regex> - -// template <class charT, class traits = regex_traits<charT>> -// class basic_regex -// { -// public: -// // types: -// typedef charT value_type; -// typedef regex_constants::syntax_option_type flag_type; -// typedef typename traits::locale_type locale_type; - -#include <regex> -#include <type_traits> - -int main() -{ - static_assert((std::is_same<std::basic_regex<char>::value_type, char>::value), ""); - static_assert((std::is_same<std::basic_regex<char>::flag_type, - std::regex_constants::syntax_option_type>::value), ""); - static_assert((std::is_same<std::basic_regex<char>::locale_type, std::locale>::value), ""); - - static_assert((std::is_same<std::basic_regex<wchar_t>::value_type, wchar_t>::value), ""); - static_assert((std::is_same<std::basic_regex<wchar_t>::flag_type, - std::regex_constants::syntax_option_type>::value), ""); - static_assert((std::is_same<std::basic_regex<wchar_t>::locale_type, std::locale>::value), ""); -} |