]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/metaparse/test/split_at_c.cpp
1 // Copyright Abel Sinkovics (abel@sinkovics.hu) 2013.
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/v1/impl/split_at_c.hpp>
7 #include <boost/metaparse/string.hpp>
9 #include <boost/mpl/pair.hpp>
10 #include <boost/mpl/assert.hpp>
12 #include <boost/type_traits/is_same.hpp>
14 #include "test_case.hpp"
16 BOOST_METAPARSE_TEST_CASE(split_at_c
)
18 using boost::metaparse::v1::impl::split_at_c
;
19 using boost::metaparse::string
;
21 using boost::mpl::pair
;
25 typedef string
<> empty
;
26 typedef string
<'h','e','l','l','o'> hello
;
28 // test_split_in_the_middle
31 pair
<string
<'h','e','l'>, string
<'l','o'> >,
32 split_at_c
<3, hello
>::type
36 // test_split_at_the_beginning
37 BOOST_MPL_ASSERT((is_same
<pair
<empty
, hello
>, split_at_c
<0, hello
>::type
>));
39 // test_split_at_the_end
40 BOOST_MPL_ASSERT((is_same
<pair
<hello
, empty
>, split_at_c
<5, hello
>::type
>));