]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/metaparse/test/remove_trailing_no_chars.cpp
Add patch for failing prerm scripts
[ceph.git] / 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)
5
6 #include <boost/metaparse/config.hpp>
7 #if BOOST_METAPARSE_STD >= 2011
8
9 #include <boost/metaparse/v1/cpp11/impl/remove_trailing_no_chars.hpp>
10 #include <boost/metaparse/string.hpp>
11
12 #include <boost/mpl/equal_to.hpp>
13 #include <boost/mpl/char.hpp>
14 #include <boost/mpl/assert.hpp>
15
16 #include "test_case.hpp"
17
18 BOOST_METAPARSE_TEST_CASE(remove_trailing_no_chars)
19 {
20 using boost::metaparse::v1::impl::remove_trailing_no_chars;
21 using boost::metaparse::string;
22
23 using boost::mpl::equal_to;
24 using boost::mpl::char_;
25
26 typedef string<'h','e','l','l','o'> hello;
27
28 // test_hello
29 BOOST_MPL_ASSERT((equal_to<hello, remove_trailing_no_chars<hello>::type>));
30
31 // test_twice
32 BOOST_MPL_ASSERT((
33 equal_to<
34 hello,
35 remove_trailing_no_chars<remove_trailing_no_chars<hello>::type>::type
36 >
37 ));
38
39 // test_hello_with_no_chars
40 BOOST_MPL_ASSERT((
41 equal_to<
42 hello,
43 remove_trailing_no_chars<
44 string<'h','e','l','l','o', BOOST_NO_CHAR, BOOST_NO_CHAR>
45 >::type
46 >
47 ));
48
49 // test_empty
50 BOOST_MPL_ASSERT((
51 equal_to<string<>, remove_trailing_no_chars<string<> >::type>
52 ));
53
54 // test_empty_with_no_chars
55 BOOST_MPL_ASSERT((
56 equal_to<
57 string<>,
58 remove_trailing_no_chars<string<BOOST_NO_CHAR, BOOST_NO_CHAR> >::type
59 >
60 ));
61 }
62
63 #endif
64