]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/metaparse/test/first_of.cpp
1 // Copyright Abel Sinkovics (abel@sinkovics.hu) 2010.
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/first_of.hpp>
7 #include <boost/metaparse/is_error.hpp>
8 #include <boost/metaparse/start.hpp>
9 #include <boost/metaparse/get_result.hpp>
13 #include <boost/mpl/equal_to.hpp>
14 #include <boost/mpl/apply_wrap.hpp>
15 #include <boost/mpl/assert.hpp>
17 #include "test_case.hpp"
19 BOOST_METAPARSE_TEST_CASE(first_of
)
21 using boost::metaparse::get_result
;
22 using boost::metaparse::first_of
;
23 using boost::metaparse::start
;
24 using boost::metaparse::is_error
;
26 using boost::mpl::equal_to
;
27 using boost::mpl::apply_wrap2
;
32 get_result
<apply_wrap2
<first_of
<lit_h
>, str_hello
, start
> >::type
,
40 get_result
<apply_wrap2
<first_of
<lit_h
, lit_e
>, str_hello
, start
> >::type
,
47 is_error
<apply_wrap2
<first_of
<lit_x
, lit_e
>, str_hello
, start
> >
52 is_error
<apply_wrap2
<first_of
<lit_h
, lit_x
>, str_hello
, start
> >
56 BOOST_MPL_ASSERT((is_error
<apply_wrap2
<first_of
<lit_h
,lit_e
>, str_
,start
> >));
62 apply_wrap2
<first_of
<lit_h
, lit_e
, lit_l
>, str_hello
, start
>