1 // Copyright Abel Sinkovics (abel@sinkovics.hu) 2015.
2 // Distributed under the Boost Software License, Version 1.0.
3 // (See accompanying file LICENSE_1_0.txt or copy at
4 // http://www.boost.org/LICENSE_1_0.txt)
6 #include <boost/metaparse/fail_at_first_char_expected.hpp>
7 #include <boost/metaparse/is_error.hpp>
8 #include <boost/metaparse/start.hpp>
9 #include <boost/metaparse/keyword.hpp>
11 #include <boost/mpl/assert.hpp>
15 #include "test_case.hpp"
17 BOOST_METAPARSE_TEST_CASE(fail_at_first_char_expected
)
19 using boost::metaparse::fail_at_first_char_expected
;
20 using boost::metaparse::is_error
;
21 using boost::metaparse::start
;
23 typedef boost::metaparse::keyword
<str_hello
> accept_hello
;
25 // test_failure_at_first_char_is_ignored
26 BOOST_MPL_ASSERT_NOT((
27 is_error
<fail_at_first_char_expected
<accept_hello
>::apply
<str_ab
, start
> >
30 // test_no_failure_is_error
33 fail_at_first_char_expected
<accept_hello
>::apply
<str_hello
, start
>
37 // test_failure_at_second_char_is_not_ignored
39 is_error
< fail_at_first_char_expected
<accept_hello
>::apply
<str_h
, start
> >