From 483eb2f56657e8e7f419ab1a4fab8dce9ade8609 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 27 Apr 2024 20:24:20 +0200 Subject: Adding upstream version 14.2.21. Signed-off-by: Daniel Baumann --- src/boost/libs/metaparse/test/repeated_one_of.cpp | 106 ++++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 src/boost/libs/metaparse/test/repeated_one_of.cpp (limited to 'src/boost/libs/metaparse/test/repeated_one_of.cpp') diff --git a/src/boost/libs/metaparse/test/repeated_one_of.cpp b/src/boost/libs/metaparse/test/repeated_one_of.cpp new file mode 100644 index 00000000..488ae46a --- /dev/null +++ b/src/boost/libs/metaparse/test/repeated_one_of.cpp @@ -0,0 +1,106 @@ +// Copyright Abel Sinkovics (abel@sinkovics.hu) 2010. +// 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 "common.hpp" + +#include +#include +#include +#include +#include +#include + +#include "test_case.hpp" + +BOOST_METAPARSE_TEST_CASE(repeated_one_of) +{ + using boost::metaparse::fail; + using boost::metaparse::get_result; + using boost::metaparse::repeated_one_of; + using boost::metaparse::start; + using boost::metaparse::one_char; + using boost::metaparse::keyword; + + using boost::mpl::equal; + using boost::mpl::apply_wrap2; + using boost::mpl::list; + using boost::mpl::vector_c; + + typedef fail test_fail; + + // test0 + BOOST_MPL_ASSERT(( + equal< + get_result, str_hello, start> >::type, + list<> + > + )); + + // test_good_sequence + BOOST_MPL_ASSERT(( + equal< + get_result< + apply_wrap2, str_hello, start> + >::type, + vector_c + > + )); + + // test_1_with_bad + BOOST_MPL_ASSERT(( + equal< + get_result< + apply_wrap2, str_hello, start> + >::type, + list< > + > + )); + + // test_2_with_first_good + BOOST_MPL_ASSERT(( + equal< + get_result< + apply_wrap2, str_hello, start> + >::type, + vector_c + > + )); + + // test_2_with_second_good + BOOST_MPL_ASSERT(( + equal< + get_result< + apply_wrap2, str_hello, start> + >::type, + vector_c + > + )); + + typedef keyword keyword_h; + typedef keyword keyword_e; + typedef keyword keyword_l; + + // test_accept_any_argument + BOOST_MPL_ASSERT(( + equal< + get_result< + apply_wrap2< + repeated_one_of, + str_hello, + start + > + >::type, + list + > + )); +} + -- cgit v1.2.3