| 1 | /////////////////////////////////////////////////////////////////////////////// |
|---|
| 2 | // test11.hpp |
|---|
| 3 | // |
|---|
| 4 | // Copyright 2004 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) |
|---|
| 7 | |
|---|
| 8 | #include "./test.hpp" |
|---|
| 9 | |
|---|
| 10 | /////////////////////////////////////////////////////////////////////////////// |
|---|
| 11 | // get_test_cases |
|---|
| 12 | // |
|---|
| 13 | template<typename BidiIterT> |
|---|
| 14 | boost::iterator_range<test_case<BidiIterT> const *> get_test_cases() |
|---|
| 15 | { |
|---|
| 16 | typedef typename boost::iterator_value<BidiIterT>::type char_type; |
|---|
| 17 | typedef test_case<BidiIterT> test_case; |
|---|
| 18 | typedef basic_regex<BidiIterT> regex_type; |
|---|
| 19 | |
|---|
| 20 | static char_type const *nilbr = 0; |
|---|
| 21 | static test_case const test_cases[] = |
|---|
| 22 | { |
|---|
| 23 | test_case |
|---|
| 24 | ( |
|---|
| 25 | "test166" |
|---|
| 26 | , L("G") |
|---|
| 27 | , regex_type(L('f') | icase(L('g'))) |
|---|
| 28 | , backrefs(L("G"), nilbr) |
|---|
| 29 | ) |
|---|
| 30 | , test_case |
|---|
| 31 | ( |
|---|
| 32 | "test167" |
|---|
| 33 | , L("aBBa") |
|---|
| 34 | , regex_type(icase(+lower)) |
|---|
| 35 | , backrefs(L("aBBa"), nilbr) |
|---|
| 36 | ) |
|---|
| 37 | , test_case |
|---|
| 38 | ( |
|---|
| 39 | "test168" |
|---|
| 40 | , L("aA") |
|---|
| 41 | , regex_type(icase(+as_xpr(L('\x61')))) |
|---|
| 42 | , backrefs(L("aA"), nilbr) |
|---|
| 43 | ) |
|---|
| 44 | , test_case |
|---|
| 45 | ( |
|---|
| 46 | "test169" |
|---|
| 47 | , L("aA") |
|---|
| 48 | , regex_type(icase(+set[L('\x61')])) |
|---|
| 49 | , backrefs(L("aA"), nilbr) |
|---|
| 50 | ) |
|---|
| 51 | , test_case |
|---|
| 52 | ( |
|---|
| 53 | "test170" |
|---|
| 54 | , L("aA") |
|---|
| 55 | , regex_type(icase(+as_xpr(L('\x0061')))) |
|---|
| 56 | , backrefs(L("aA"), nilbr) |
|---|
| 57 | ) |
|---|
| 58 | , test_case |
|---|
| 59 | ( |
|---|
| 60 | "test171" |
|---|
| 61 | , L("aA") |
|---|
| 62 | , regex_type(icase(+set[L('\x0061')])) |
|---|
| 63 | , backrefs(L("aA"), nilbr) |
|---|
| 64 | ) |
|---|
| 65 | , test_case |
|---|
| 66 | ( |
|---|
| 67 | "test172" |
|---|
| 68 | , L("abcd") |
|---|
| 69 | , regex_type(L('a') >> +(s1= L('b') | (s2= *(s3= L('c')))) >> L('d')) |
|---|
| 70 | , backrefs(L("abcd"), L(""), L(""), L(""), nilbr) |
|---|
| 71 | ) |
|---|
| 72 | , test_case |
|---|
| 73 | ( |
|---|
| 74 | "test173" |
|---|
| 75 | , L("abcd") |
|---|
| 76 | , regex_type(L('a') >> +(s1= L('b') | (s2= !(s3= L('c')))) >> L('d')) |
|---|
| 77 | , backrefs(L("abcd"), L(""), L(""), L(""), nilbr) |
|---|
| 78 | ) |
|---|
| 79 | }; |
|---|
| 80 | |
|---|
| 81 | return boost::make_iterator_range(test_cases); |
|---|
| 82 | } |
|---|
| 83 | |
|---|