1 // Copyright Abel Sinkovics (abel@sinkovics.hu) 2016.
2 // Distributed under the Boost Software License, Version 1.0.
3 // (See accompanying file LICENSE_1_0.txt or copy at
4 // http://www.boost.org/LICENSE_1_0.txt)
6 #define BOOST_METAPARSE_LIMIT_STRING_SIZE 4
8 #include <boost/type_traits/is_same.hpp>
11 #include "test_case.hpp"
12 #include "string_macros.hpp"
14 #include <boost/metaparse/string.hpp>
16 #ifndef BOOST_METAPARSE_V1_CONFIG_NO_BOOST_METAPARSE_STRING
18 using boost::metaparse::string
;
21 BOOST_METAPARSE_TEST_CASE(string_macro
)
24 is_same
<string
<'a', 'b', 'c', 'd'>, BOOST_METAPARSE_STRING("abcd")>
28 #undef BOOST_METAPARSE_LIMIT_STRING_SIZE
29 #define BOOST_METAPARSE_LIMIT_STRING_SIZE 8
31 BOOST_METAPARSE_TEST_CASE(string_macro_redefined_length_limit
)
34 is_same
<string
<'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'>,
35 BOOST_METAPARSE_STRING("abcdefgh")>
39 #undef BOOST_METAPARSE_LIMIT_STRING_SIZE
40 #define BOOST_METAPARSE_LIMIT_STRING_SIZE 127
42 BOOST_METAPARSE_TEST_CASE(creating_long_string_with_macro
)
47 BOOST_METAPARSE_TEST_CHARS_100
,
48 BOOST_METAPARSE_TEST_CHARS_10
,
49 BOOST_METAPARSE_TEST_CHARS_10
,
50 '0', '1', '2', '3', '4', '5', '6'
52 BOOST_METAPARSE_STRING(
53 BOOST_METAPARSE_TEST_STRING_100
54 BOOST_METAPARSE_TEST_STRING_10
55 BOOST_METAPARSE_TEST_STRING_10