]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/metaparse/test/remove_trailing_no_chars.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/config.hpp>
7 #if BOOST_METAPARSE_STD >= 2011
9 #include <boost/metaparse/v1/cpp11/impl/remove_trailing_no_chars.hpp>
10 #include <boost/metaparse/string.hpp>
12 #include <boost/mpl/equal_to.hpp>
13 #include <boost/mpl/char.hpp>
14 #include <boost/mpl/assert.hpp>
16 #include "test_case.hpp"
18 BOOST_METAPARSE_TEST_CASE(remove_trailing_no_chars
)
20 using boost::metaparse::v1::impl::remove_trailing_no_chars
;
21 using boost::metaparse::string
;
23 using boost::mpl::equal_to
;
24 using boost::mpl::char_
;
26 typedef string
<'h','e','l','l','o'> hello
;
29 BOOST_MPL_ASSERT((equal_to
<hello
, remove_trailing_no_chars
<hello
>::type
>));
35 remove_trailing_no_chars
<remove_trailing_no_chars
<hello
>::type
>::type
39 // test_hello_with_no_chars
43 remove_trailing_no_chars
<
44 string
<'h','e','l','l','o', BOOST_NO_CHAR
, BOOST_NO_CHAR
>
51 equal_to
<string
<>, remove_trailing_no_chars
<string
<> >::type
>
54 // test_empty_with_no_chars
58 remove_trailing_no_chars
<string
<BOOST_NO_CHAR
, BOOST_NO_CHAR
> >::type