]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/metaparse/test/look_ahead.cpp
1 // Copyright Abel Sinkovics (abel@sinkovics.hu) 2011.
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/look_ahead.hpp>
7 #include <boost/metaparse/start.hpp>
8 #include <boost/metaparse/get_result.hpp>
9 #include <boost/metaparse/digit_val.hpp>
10 #include <boost/metaparse/fail.hpp>
11 #include <boost/metaparse/is_error.hpp>
12 #include <boost/metaparse/get_remaining.hpp>
16 #include <boost/mpl/apply_wrap.hpp>
17 #include <boost/mpl/equal_to.hpp>
18 #include <boost/mpl/equal.hpp>
19 #include <boost/mpl/assert.hpp>
21 #include "test_case.hpp"
23 BOOST_METAPARSE_TEST_CASE(look_ahead
)
26 using boost::metaparse::get_result
;
27 using boost::metaparse::look_ahead
;
28 using boost::metaparse::digit_val
;
29 using boost::metaparse::start
;
30 using boost::metaparse::is_error
;
31 using boost::metaparse::fail
;
32 using boost::metaparse::get_remaining
;
34 using boost::mpl::equal_to
;
35 using boost::mpl::apply_wrap2
;
36 using boost::mpl::equal
;
38 // test_returns_result
42 get_result
<apply_wrap2
<look_ahead
<digit_val
>, str_1983
, start
> >::type
48 is_error
<apply_wrap2
<look_ahead
<fail
<int13
> >, str_1983
, start
> >
51 // test_doesnt_process_input
55 get_remaining
<apply_wrap2
<look_ahead
<digit_val
>, str_1983
, start
> >::type