Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_34_1/libs/xpressive/test/test10.hpp @ 69

Last change on this file since 69 was 29, checked in by landauf, 17 years ago

updated boost from 1_33_1 to 1_34_1

File size: 2.1 KB
Line 
1///////////////////////////////////////////////////////////////////////////////
2// test10.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//
13template<typename BidiIterT>
14boost::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            "test16"
26          , L("foobarboo")
27          , regex_type(L('b') >> +_ >> L("ar") >> eos)
28          , no_match
29        )
30      , test_case
31        (
32            "test17"
33          , L("foobarboo")
34          , regex_type(L('b') >> +_ >> L('o') >> eos)
35          , backrefs(L("barboo"), nilbr)
36        )
37      , test_case
38        (
39            "test18"
40          , L("foobarboo")
41          , regex_type(L('b') >> +_ >> L("oo") >> eos)
42          , backrefs(L("barboo"), nilbr)
43        )
44      , test_case
45        (
46            "test19"
47          , L("+1234.56789F")
48          , regex_type(bos >> (s1= !(set=L('-'),L('+')) >> +range(L('0'),L('9'))
49                           >> !(s2= L('.') >> *range(L('0'),L('9'))))
50                           >> (s3= (set=L('C'),L('F'))) >> eos)
51          , backrefs(L("+1234.56789F"), L("+1234.56789"), L(".56789"), L("F"), nilbr)
52        )
53      , test_case
54        (
55            "test20"
56          , L("+1234.56789")
57          , regex_type( !(s1= as_xpr(L('+'))|L('-')) >> (s2= +range(L('0'),L('9')) >> !as_xpr(L('.')) >> *range(L('0'),L('9')) |
58                        L('.') >> +range(L('0'),L('9'))) >> !(s3= (set=L('e'),L('E')) >> !(s4= as_xpr(L('+'))|L('-')) >> +range(L('0'),L('9'))))
59          , backrefs(L("+1234.56789"), L("+"), L("1234.56789"), L(""), L(""), nilbr)
60        )
61    };
62
63    return boost::make_iterator_range(test_cases);
64}
65
Note: See TracBrowser for help on using the repository browser.