]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/metaparse/test/update_c.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/cpp98/impl/update_c.hpp>
10 #include <boost/metaparse/string.hpp>
12 #include <boost/mpl/equal_to.hpp>
13 #include <boost/mpl/assert.hpp>
15 #include "test_case.hpp"
17 BOOST_METAPARSE_TEST_CASE(update_c
)
19 using boost::metaparse::v1::impl::update_c
;
20 using boost::metaparse::string
;
22 using boost::mpl::equal_to
;
24 typedef string
<'h','e','l','l','o'> hello
;
26 // test_update_first_char
28 equal_to
<string
<'x','e','l','l','o'>, update_c
<hello
, 0, 'x'>::type
>
31 // test_update_middle_char
33 equal_to
<string
<'h','e','x','l','o'>, update_c
<hello
, 2, 'x'>::type
>
36 // test_update_last_char
38 equal_to
<string
<'h','e','l','l','x'>, update_c
<hello
, 4, 'x'>::type
>