toml11/tests/test_lex_boolean.cpp
Moritz Klammler 10fd14f8b9 Consistent unit test header inclusion order
This patch consistently changes the inclusion order for unit test files
to the following:

 1. The header of the unit under test (using <> includes).
 2. The unit_test.hpp header (using "" includes).
 3. Any additional auxiliary test headers (using "" includes and sorted alphabetically).
 4. Additional system headers needed for the test (using <> includes and sorted alphabetically).
 5. Conditionally included system headers (using <> includes).

Putting the unit under test's header at the very beginning has the
advantage of also testing that the header is self-contained.  It also
makes it very quick to tell what unit is tested in this file.
2022-09-29 19:02:52 +02:00

24 lines
660 B
C++

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