]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | /*============================================================================= |
2 | Copyright (c) 2001-2015 Joel de Guzman | |
3 | Copyright (c) 2001-2010 Hartmut Kaiser | |
4 | ||
5 | Distributed under the Boost Software License, Version 1.0. (See accompanying | |
6 | file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | |
7 | =============================================================================*/ | |
7c673cae FG |
8 | #include <boost/spirit/home/x3.hpp> |
9 | #include <iostream> | |
10 | #include "test.hpp" | |
11 | ||
12 | int | |
13 | main() | |
14 | { | |
15 | using spirit_test::test; | |
16 | using spirit_test::test_attr; | |
17 | using boost::spirit::x3::matches; | |
18 | using boost::spirit::x3::char_; | |
19 | ||
f67539c2 TL |
20 | BOOST_SPIRIT_ASSERT_CONSTEXPR_CTORS(matches['x']); |
21 | ||
7c673cae FG |
22 | { |
23 | BOOST_TEST(test("x", matches[char_])); | |
24 | bool result = false; | |
25 | BOOST_TEST(test_attr("x", matches[char_], result) && result); | |
26 | } | |
27 | ||
28 | { | |
29 | BOOST_TEST(!test("y", matches[char_('x')])); | |
30 | BOOST_TEST(!test("y", matches['x'])); | |
31 | bool result = true; | |
32 | BOOST_TEST(test_attr("y", matches[char_('x')], result, false) && !result); | |
33 | result = true; | |
34 | BOOST_TEST(test_attr("y", matches['x'], result, false) && !result); | |
35 | } | |
36 | ||
37 | return boost::report_errors(); | |
38 | } |