]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
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/v1/impl/concat.hpp> | |
7 | #include <boost/metaparse/string.hpp> | |
8 | ||
9 | #include <boost/mpl/equal_to.hpp> | |
10 | #include <boost/mpl/char.hpp> | |
11 | #include <boost/mpl/assert.hpp> | |
12 | ||
13 | #include "test_case.hpp" | |
14 | ||
15 | BOOST_METAPARSE_TEST_CASE(concat) | |
16 | { | |
17 | using boost::metaparse::v1::impl::concat; | |
18 | using boost::metaparse::string; | |
19 | ||
20 | using boost::mpl::equal_to; | |
21 | ||
22 | typedef string<> empty; | |
23 | typedef string<'h','e','l','l','o'> hello; | |
24 | ||
25 | // test_empty_empty | |
26 | BOOST_MPL_ASSERT((equal_to<empty, concat<empty, empty>::type>)); | |
27 | ||
28 | // test_empty_hello | |
29 | BOOST_MPL_ASSERT((equal_to<hello, concat<empty, hello>::type>)); | |
30 | ||
31 | // test_hello_empty | |
32 | BOOST_MPL_ASSERT((equal_to<hello, concat<hello, empty>::type>)); | |
33 | ||
34 | // test_hello_hello | |
35 | BOOST_MPL_ASSERT(( | |
36 | equal_to< | |
37 | string<'h','e','l','l','o','h','e','l','l','o'>, | |
38 | concat<hello, hello>::type | |
39 | > | |
40 | )); | |
41 | } | |
42 | ||
43 |