• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright Abel Sinkovics (abel@sinkovics.hu) 2012.
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 
6 #include <boost/metaparse/util/int_to_digit.hpp>
7 
8 #include <boost/mpl/equal_to.hpp>
9 #include <boost/mpl/char.hpp>
10 #include <boost/mpl/int.hpp>
11 #include <boost/mpl/assert.hpp>
12 
13 #include "test_case.hpp"
14 
BOOST_METAPARSE_TEST_CASE(int_to_digit)15 BOOST_METAPARSE_TEST_CASE(int_to_digit)
16 {
17   using boost::metaparse::util::int_to_digit;
18 
19   using boost::mpl::char_;
20   using boost::mpl::int_;
21   using boost::mpl::equal_to;
22 
23   // test0
24   BOOST_MPL_ASSERT((equal_to<char_<'0'>, int_to_digit<int_<0> >::type>));
25 
26   // test5
27   BOOST_MPL_ASSERT((equal_to<char_<'5'>, int_to_digit<int_<5> >::type>));
28 
29   // test9
30   BOOST_MPL_ASSERT((equal_to<char_<'9'>, int_to_digit<int_<9> >::type>));
31 }
32 
33 
34