Files
toml11/tests/test_lex_boolean.cpp
Moritz Klammler 81c5ba9082 Define BOOST_TEST_MODULE in CMake
This removes one #define from each unit test file and ensures
consistency between file and module names.  This consistency, was not
strictly maintained before.  I hope that any discrepancies were
unintentional and that a 1:1 mapping is actually what is desired.

Since the definition is now done at one single place, it would be easy
to apply transformations like removing the 'test_' prefix or replacing
'_' with '-' if this should be desired.
2022-09-29 19:02:52 +02:00

24 lines
660 B
C++

#include "unit_test.hpp"
#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");
}