// 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 #include "test_case.hpp" using boost::metaparse::reject; using boost::metaparse::get_position; namespace { template struct new_message { typedef new_message type; }; struct change_message { typedef change_message type; template struct apply : new_message {}; }; } BOOST_METAPARSE_TEST_CASE(transform_error_message) { using boost::metaparse::transform_error_message; using boost::metaparse::start; using boost::metaparse::string; using boost::metaparse::lit_c; using boost::metaparse::error::literal_expected; using boost::is_same; typedef string<'H','e','l','l','o'> s; // test_transform_error_message_does_not_change_accept BOOST_MPL_ASSERT(( is_same< lit_c<'H'>::apply::type, transform_error_message, change_message>::apply::type > )); // test_transform_is_called BOOST_MPL_ASSERT(( is_same< reject >, start>, transform_error_message, change_message>::apply::type > )); }