is_whitespace.cpp 836 B

1234567891011121314151617181920212223242526272829303132
  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/util/is_whitespace.hpp>
  6. #include "common.hpp"
  7. #include <boost/mpl/apply_wrap.hpp>
  8. #include <boost/mpl/not.hpp>
  9. #include <boost/mpl/assert.hpp>
  10. #include "test_case.hpp"
  11. BOOST_METAPARSE_TEST_CASE(util_is_whitespace)
  12. {
  13. using boost::metaparse::util::is_whitespace;
  14. using boost::mpl::apply_wrap1;
  15. using boost::mpl::not_;
  16. // test_space
  17. BOOST_MPL_ASSERT((apply_wrap1<is_whitespace<>, char_space>));
  18. // test_tab
  19. BOOST_MPL_ASSERT((apply_wrap1<is_whitespace<>, char_tab>));
  20. // test_non_whitespace
  21. BOOST_MPL_ASSERT((not_<apply_wrap1<is_whitespace<>, char_a> >));
  22. }