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/iterate.cpp | 73 +++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 src/boost/libs/metaparse/test/iterate.cpp (limited to 'src/boost/libs/metaparse/test/iterate.cpp') diff --git a/src/boost/libs/metaparse/test/iterate.cpp b/src/boost/libs/metaparse/test/iterate.cpp new file mode 100644 index 00000000..b237b93c --- /dev/null +++ b/src/boost/libs/metaparse/test/iterate.cpp @@ -0,0 +1,73 @@ +// 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 "common.hpp" + +#include +#include +#include +#include +#include + +#include "test_case.hpp" + +BOOST_METAPARSE_TEST_CASE(iterate) +{ + using boost::metaparse::is_error; + using boost::metaparse::iterate; + using boost::metaparse::one_char; + using boost::metaparse::start; + using boost::metaparse::get_result; + + using boost::mpl::apply_wrap2; + using boost::mpl::equal; + using boost::mpl::list; + using boost::mpl::vector_c; + + // test_empty_input + BOOST_MPL_ASSERT(( + is_error, str_, start> > + )); + + // test0 + BOOST_MPL_ASSERT(( + equal< + get_result, str_hello, start> >::type, + list<> + > + )); + + // test1 + BOOST_MPL_ASSERT(( + equal< + get_result, str_hello, start> >::type, + vector_c + > + )); + + // test2 + BOOST_MPL_ASSERT(( + equal< + get_result, str_hello, start> >::type, + vector_c + > + )); + + // test3 + BOOST_MPL_ASSERT(( + equal< + get_result, str_hello, start> >::type, + vector_c + > + )); +} + + -- cgit v1.2.3