]>
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/update_c.hpp> | |
7 | #include <boost/metaparse/string.hpp> | |
8 | ||
9 | #include <boost/mpl/equal_to.hpp> | |
10 | #include <boost/mpl/assert.hpp> | |
11 | ||
12 | #include "test_case.hpp" | |
13 | ||
14 | BOOST_METAPARSE_TEST_CASE(update_c) | |
15 | { | |
16 | using boost::metaparse::v1::impl::update_c; | |
17 | using boost::metaparse::string; | |
18 | ||
19 | using boost::mpl::equal_to; | |
20 | ||
21 | typedef string<'h','e','l','l','o'> hello; | |
22 | ||
23 | // test_update_first_char | |
24 | BOOST_MPL_ASSERT(( | |
25 | equal_to<string<'x','e','l','l','o'>, update_c<hello, 0, 'x'>::type> | |
26 | )); | |
27 | ||
28 | // test_update_middle_char | |
29 | BOOST_MPL_ASSERT(( | |
30 | equal_to<string<'h','e','x','l','o'>, update_c<hello, 2, 'x'>::type> | |
31 | )); | |
32 | ||
33 | // test_update_last_char | |
34 | BOOST_MPL_ASSERT(( | |
35 | equal_to<string<'h','e','l','l','x'>, update_c<hello, 4, 'x'>::type> | |
36 | )); | |
37 | } | |
38 |