long_string.cpp 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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)
  5. #include <boost/metaparse/config.hpp>
  6. #if BOOST_METAPARSE_STD >= 2011
  7. #define BOOST_METAPARSE_LIMIT_STRING_SIZE 1024
  8. #include <boost/metaparse/string.hpp>
  9. #include <boost/type_traits/is_same.hpp>
  10. #include "common.hpp"
  11. #include "test_case.hpp"
  12. #include "string_macros.hpp"
  13. #ifndef BOOST_METAPARSE_V1_CONFIG_NO_BOOST_METAPARSE_STRING
  14. using boost::metaparse::string;
  15. using boost::is_same;
  16. BOOST_METAPARSE_TEST_CASE(creating_very_long_string)
  17. {
  18. // The Oracle Studio limit is 127 characters
  19. #ifndef __SUNPRO_CC
  20. BOOST_MPL_ASSERT((
  21. is_same<
  22. string<
  23. BOOST_METAPARSE_TEST_CHARS_100,
  24. BOOST_METAPARSE_TEST_CHARS_100,
  25. BOOST_METAPARSE_TEST_CHARS_100,
  26. BOOST_METAPARSE_TEST_CHARS_100,
  27. BOOST_METAPARSE_TEST_CHARS_100,
  28. BOOST_METAPARSE_TEST_CHARS_10,
  29. '0', '1'
  30. >,
  31. BOOST_METAPARSE_STRING(
  32. BOOST_METAPARSE_TEST_STRING_100
  33. BOOST_METAPARSE_TEST_STRING_100
  34. BOOST_METAPARSE_TEST_STRING_100
  35. BOOST_METAPARSE_TEST_STRING_100
  36. BOOST_METAPARSE_TEST_STRING_100
  37. BOOST_METAPARSE_TEST_STRING_10
  38. "01"
  39. )
  40. >
  41. ));
  42. #endif
  43. }
  44. #endif
  45. #endif