next_digit.cpp 788 B

12345678910111213141516171819202122232425
  1. // Copyright Abel Sinkovics (abel@sinkovics.hu) 2015.
  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/v1/impl/next_digit.hpp>
  6. #include <boost/mpl/assert.hpp>
  7. #include <boost/mpl/equal_to.hpp>
  8. #include <boost/mpl/int.hpp>
  9. #include "test_case.hpp"
  10. BOOST_METAPARSE_TEST_CASE(next_digit)
  11. {
  12. using boost::metaparse::v1::impl::next_digit;
  13. using boost::mpl::equal_to;
  14. using boost::mpl::int_;
  15. BOOST_MPL_ASSERT((equal_to<int_< 0>, next_digit::apply<int_<0>, int_<0> > >));
  16. BOOST_MPL_ASSERT((equal_to<int_<10>, next_digit::apply<int_<1>, int_<0> > >));
  17. BOOST_MPL_ASSERT((equal_to<int_<13>, next_digit::apply<int_<1>, int_<3> > >));
  18. }