1 // Copyright (c) 2014-2020 Dr. Colin Hirsch and Daniel Frey
2 // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
3 
4 #ifndef TAO_PEGTL_SRC_TEST_PEGTL_VERIFY_CHAR_HPP
5 #define TAO_PEGTL_SRC_TEST_PEGTL_VERIFY_CHAR_HPP
6 
7 #include <cstdlib>
8 #include <string>
9 
unit_test()10 #include "result_type.hpp"
11 #include "verify_rule.hpp"
12 
13 namespace TAO_PEGTL_NAMESPACE
14 {
15    template< typename Rule >
16    void verify_char( const std::size_t line, const char* file, const char data, const result_type result )
17    {
18       verify_rule< Rule >( line, file, std::string( std::size_t( 1 ), data ), result, ( result == result_type::success ) ? 0 : 1 );
19    }
20 
21    template< typename Rule >
22    void verify_char( const std::size_t line, const char* file, const char data, const bool result )
23    {
24       verify_char< Rule >( line, file, data, result ? result_type::success : result_type::local_failure );
25    }
26 
27 }  // namespace TAO_PEGTL_NAMESPACE
28 
29 #endif
30