fail.cpp 758 B

123456789101112131415161718192021222324252627282930
  1. // Copyright Abel Sinkovics (abel@sinkovics.hu) 2010.
  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/fail.hpp>
  6. #include <boost/metaparse/is_error.hpp>
  7. #include <boost/metaparse/start.hpp>
  8. #include "common.hpp"
  9. #include <boost/mpl/apply_wrap.hpp>
  10. #include <boost/mpl/assert.hpp>
  11. #include "test_case.hpp"
  12. BOOST_METAPARSE_TEST_CASE(fail)
  13. {
  14. using boost::metaparse::is_error;
  15. using boost::metaparse::fail;
  16. using boost::metaparse::start;
  17. using boost::mpl::apply_wrap2;
  18. // test_fail_for_non_empty_string
  19. BOOST_MPL_ASSERT((
  20. is_error<apply_wrap2<fail<test_failure>, str_hello, start> >
  21. ));
  22. }