From 19fcec84d8d7d21e796c7624e521b60d28ee21ed Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 20:45:59 +0200 Subject: Adding upstream version 16.2.11+ds. Signed-off-by: Daniel Baumann --- src/boost/libs/metaparse/test/one_char_test.hpp | 103 ++++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 src/boost/libs/metaparse/test/one_char_test.hpp (limited to 'src/boost/libs/metaparse/test/one_char_test.hpp') diff --git a/src/boost/libs/metaparse/test/one_char_test.hpp b/src/boost/libs/metaparse/test/one_char_test.hpp new file mode 100644 index 000000000..033415b50 --- /dev/null +++ b/src/boost/libs/metaparse/test/one_char_test.hpp @@ -0,0 +1,103 @@ +// Copyright Abel Sinkovics (abel@sinkovics.hu) 2010 - 2011. +// 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) + +// This header file contains code that is reused by other cpp files + +#include +#include +#include +#include +#include +#include +#include + +#include "common.hpp" + +#include +#include +#include + +#include "test_case.hpp" + +namespace +{ + using boost::metaparse::start; + + using boost::mpl::list_c; + using boost::mpl::apply_wrap2; + + typedef list_c unix_multi_line_text; + typedef list_c dos_multi_line_text; + typedef list_c mac_multi_line_text; + + typedef apply_wrap2 parse_first_char; +} + +BOOST_METAPARSE_TEST_CASE(TEST_NAME) +{ + using boost::metaparse::get_result; + using boost::metaparse::get_remaining; + using boost::metaparse::get_position; + using boost::metaparse::is_error; + using boost::metaparse::iterate_c; + using boost::metaparse::get_line; + + using boost::mpl::equal_to; + + // test_for_non_empty_string + BOOST_MPL_ASSERT((equal_to::type, char_h>)); + + // test_for_non_empty_string_second + BOOST_MPL_ASSERT(( + equal_to< + get_result< + apply_wrap2< + oc, + get_remaining::type, + get_position::type + > + >::type, + char_e + > + )); + + // test_for_empty_string + BOOST_MPL_ASSERT((is_error >)); + + // test_unix_multi_line_text + BOOST_MPL_ASSERT(( + equal_to< + int2, + get_line< + get_position< + apply_wrap2, unix_multi_line_text, start> + > + > + > + )); + + // test_dos_multi_line_text + BOOST_MPL_ASSERT(( + equal_to< + int2, + get_line< + get_position, dos_multi_line_text, start> > + > + > + )); + + // test_mac_multi_line_text + BOOST_MPL_ASSERT(( + equal_to< + int2, + get_line< + get_position, mac_multi_line_text, start> > + > + > + )); +} + + + -- cgit v1.2.3