1 ///////////////////////////////////////////////////////////////////////////////
4 // Copyright 2008 Eric Niebler. Distributed under the Boost
5 // Software License, Version 1.0. (See accompanying file
6 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
10 ///////////////////////////////////////////////////////////////////////////////
13 template<typename BidiIterT>
14 boost::iterator_range<xpr_test_case<BidiIterT> const *> get_test_cases()
16 typedef typename boost::iterator_value<BidiIterT>::type char_type;
17 typedef xpr_test_case<BidiIterT> xpr_test_case;
18 typedef basic_regex<BidiIterT> regex_type;
20 static char_type const *nilbr = 0;
21 static xpr_test_case const test_cases[] =
27 , regex_type(~before(bol) >> L('x'))
34 , regex_type(~before(bos) >> L('x'))
35 , backrefs(L("x"), nilbr)
41 , regex_type(~before(bos) >> L('x'))
42 , backrefs(L("x"), nilbr)
48 , regex_type(bos >> (L('(') >> (s1= nil) | (s2= nil)) >> +_w >> (L(')') >> s1 | s2) >> eos)
49 , backrefs(L("(this)"), L(""), L(""), nilbr)
55 , regex_type(bos >> (L('(') >> (s1= nil) | (s2= nil)) >> +_w >> (L(')') >> s1 | s2) >> eos)
56 , backrefs(L("this"), L(""), L(""), nilbr)
62 , regex_type(bos >> (L('(') >> (s1= nil) | (s2= nil)) >> +_w >> (L(')') >> s1 | s2) >> eos)
69 , regex_type(bos >> (L('(') >> (s1= nil) | (s2= nil)) >> +_w >> (L(')') >> s1 | s2) >> eos)
77 , backrefs(L("123"), nilbr)
83 , regex_type(+set[alpha | ~alpha])
84 , backrefs(L("abba123abba"), nilbr)
90 , regex_type(+~set[~alpha])
91 , backrefs(L("abba"), nilbr)
97 // , regex_type(as_xpr(L("[[:alpha:]\\y]+")))
98 // , backrefs(L("123abba123"), nilbr)
104 , regex_type(+~set[~alnum | ~digit])
105 , backrefs(L("123"), nilbr)
111 , regex_type(icase(bos >> repeat<4>(s1= L('a') >> !s1) >> eos))
112 , backrefs(L("aaaaA"), L("A"), nilbr)
118 , regex_type(icase(bos >> repeat<4>(s1= L('a') >> !s1) >> eos))
119 , backrefs(L("aaaaAa"), L("Aa"), nilbr)
123 return boost::make_iterator_range(test_cases);