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(as_xpr(L("foo")))
28 , backrefs(L("foo"), nilbr)
34 , regex_type(as_xpr(L("bar")))
35 , backrefs(L("bar"), nilbr)
41 , regex_type(as_xpr(L("bat")))
48 , regex_type(L('b') >> *_ >> L("ar"))
49 , backrefs(L("bar"), nilbr)
55 , regex_type(L('b') >> *_ >> L('r'))
56 , backrefs(L("bar"), nilbr)
62 , regex_type(L('b') >> *_ >> L('b'))
63 , backrefs(L("barb"), nilbr)
69 , regex_type(L('b') >> *_ >> L('o'))
70 , backrefs(L("barboo"), nilbr)
76 , regex_type(L('b') >> *_ >> L("oo"))
77 , backrefs(L("barboo"), nilbr)
83 , regex_type(L('b') >> +_ >> L("ar"))
90 , regex_type(L('b') >> +_ >> L('r'))
91 , backrefs(L("bar"), nilbr)
97 , regex_type(L('b') >> +_ >> L('b'))
98 , backrefs(L("barb"), nilbr)
104 , regex_type(L('b') >> +_ >> L('o'))
105 , backrefs(L("barboo"), nilbr)
111 , regex_type(L('b') >> +_ >> L("oo"))
112 , backrefs(L("barboo"), nilbr)
118 , regex_type(bos >> L("foo"))
119 , backrefs(L("foo"), nilbr)
125 , regex_type(bos >> L('b') >> *_ >> L("ar"))
132 , regex_type(!icase(L('f') >> *as_xpr(L('o'))))
133 , backrefs(L("fOo"), nilbr)
137 return boost::make_iterator_range(test_cases);