// Copyright Abel Sinkovics (abel@sinkovics.hu) 2013. // 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 "common.hpp" #include #include #include #include "test_case.hpp" BOOST_METAPARSE_TEST_CASE(one_of_c) { using boost::metaparse::is_error; using boost::metaparse::one_of_c; using boost::metaparse::start; using boost::metaparse::get_result; using boost::mpl::apply_wrap2; using boost::mpl::equal_to; // test0 BOOST_MPL_ASSERT((is_error, str_hello, start> >)); // test_1_with_good BOOST_MPL_ASSERT(( equal_to< get_result, str_hello, start> >::type, char_h > )); // test_1_with_bad BOOST_MPL_ASSERT(( is_error, str_hello, start> > )); // test_2_with_two_good BOOST_MPL_ASSERT(( equal_to< get_result, str_hello, start> >::type, char_h > )); // test_2_with_first_good BOOST_MPL_ASSERT(( equal_to< get_result, str_hello, start> >::type, char_h > )); // test_2_with_second_good BOOST_MPL_ASSERT(( equal_to< get_result, str_hello, start> >::type, char_h > )); // test_2_with_two_bad BOOST_MPL_ASSERT(( is_error, str_hello, start> > )); }