1 | /////////////////////////////////////////////////////////////////////////////// |
---|---|
2 | // test_static.cpp |
3 | // |
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) |
7 | |
8 | #include <boost/xpressive/xpressive_static.hpp> |
9 | #include <boost/test/unit_test.hpp> |
10 | |
11 | /////////////////////////////////////////////////////////////////////////////// |
12 | // test_main |
13 | void test_main() |
14 | { |
15 | using namespace boost::xpressive; |
16 | |
17 | std::string str("bar"); |
18 | sregex rx = 'b' >> *_ >> "ar"; |
19 | smatch what; |
20 | |
21 | if(!regex_match(rng&: str, what, re: rx)) |
22 | { |
23 | BOOST_ERROR("oops"); |
24 | } |
25 | } |
26 | |
27 | using namespace boost::unit_test; |
28 | |
29 | /////////////////////////////////////////////////////////////////////////////// |
30 | // init_unit_test_suite |
31 | // |
32 | test_suite* init_unit_test_suite( int argc, char* argv[] ) |
33 | { |
34 | test_suite *test = BOOST_TEST_SUITE("test_static"); |
35 | test->add(BOOST_TEST_CASE(&test_main)); |
36 | return test; |
37 | } |
38 | |
39 |