2018-12-04 20:30:21 +09:00
|
|
|
#define BOOST_TEST_MODULE "test_lex_boolean"
|
2022-09-15 19:54:27 +02:00
|
|
|
#ifdef UNITTEST_FRAMEWORK_LIBRARY_EXIST
|
2018-12-04 20:30:21 +09:00
|
|
|
#include <boost/test/unit_test.hpp>
|
2022-09-15 19:54:27 +02:00
|
|
|
#else
|
|
|
|
#include <boost/test/included/unit_test.hpp>
|
|
|
|
#endif
|
2018-12-04 20:30:21 +09:00
|
|
|
#include <toml/lexer.hpp>
|
|
|
|
#include "test_lex_aux.hpp"
|
|
|
|
|
|
|
|
using namespace toml;
|
|
|
|
using namespace detail;
|
|
|
|
|
|
|
|
BOOST_AUTO_TEST_CASE(test_correct)
|
|
|
|
{
|
|
|
|
TOML11_TEST_LEX_ACCEPT(lex_boolean, "true", "true");
|
|
|
|
TOML11_TEST_LEX_ACCEPT(lex_boolean, "false", "false");
|
|
|
|
TOML11_TEST_LEX_ACCEPT(lex_boolean, "true # trailing", "true");
|
|
|
|
TOML11_TEST_LEX_ACCEPT(lex_boolean, "false # trailing", "false");
|
|
|
|
}
|
|
|
|
|
|
|
|
BOOST_AUTO_TEST_CASE(test_invalid)
|
|
|
|
{
|
|
|
|
TOML11_TEST_LEX_REJECT(lex_boolean, "TRUE");
|
|
|
|
TOML11_TEST_LEX_REJECT(lex_boolean, "FALSE");
|
|
|
|
TOML11_TEST_LEX_REJECT(lex_boolean, "True");
|
|
|
|
TOML11_TEST_LEX_REJECT(lex_boolean, "False");
|
|
|
|
}
|