// Copyright Abel Sinkovics (abel@sinkovics.hu) 2015. // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) #include #include #include #include #include #include #include #include #include "test_case.hpp" using boost::metaparse::reject; using boost::metaparse::get_position; namespace { struct new_message { typedef new_message type; }; struct change_message { typedef change_message type; template struct apply : reject > {}; }; } BOOST_METAPARSE_TEST_CASE(transform_error) { using boost::metaparse::transform_error; using boost::metaparse::start; using boost::metaparse::string; using boost::metaparse::lit_c; using boost::is_same; typedef string<'H','e','l','l','o'> s; // test_transform_error_does_not_change_accept BOOST_MPL_ASSERT(( is_same< lit_c<'H'>::apply::type, transform_error, change_message>::apply::type > )); // test_transform_is_called BOOST_MPL_ASSERT(( is_same< reject, transform_error, change_message>::apply::type > )); }