]>
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/v1/impl/remove_trailing_no_chars.hpp>
7 #include <boost/metaparse/string.hpp>
9 #include <boost/mpl/equal_to.hpp>
10 #include <boost/mpl/char.hpp>
11 #include <boost/mpl/assert.hpp>
13 #include "test_case.hpp"
15 BOOST_METAPARSE_TEST_CASE(remove_trailing_no_chars
)
17 using boost::metaparse::v1::impl::remove_trailing_no_chars
;
18 using boost::metaparse::string
;
20 using boost::mpl::equal_to
;
21 using boost::mpl::char_
;
23 typedef string
<'h','e','l','l','o'> hello
;
26 BOOST_MPL_ASSERT((equal_to
<hello
, remove_trailing_no_chars
<hello
>::type
>));
32 remove_trailing_no_chars
<remove_trailing_no_chars
<hello
>::type
>::type
36 // test_hello_with_no_chars
40 remove_trailing_no_chars
<
41 string
<'h','e','l','l','o', BOOST_NO_CHAR
, BOOST_NO_CHAR
>
48 equal_to
<string
<>, remove_trailing_no_chars
<string
<> >::type
>
51 // test_empty_with_no_chars
55 remove_trailing_no_chars
<string
<BOOST_NO_CHAR
, BOOST_NO_CHAR
> >::type