mirror of
https://github.com/ToruNiina/toml11.git
synced 2025-12-16 03:08:52 +08:00
add a test for parser (WIP)
This commit is contained in:
24
tests/test_parse_boolean.cpp
Normal file
24
tests/test_parse_boolean.cpp
Normal file
@@ -0,0 +1,24 @@
|
||||
#define BOOST_TEST_MODULE "test_parse_boolean"
|
||||
#ifdef UNITTEST_FRAMEWORK_LIBRARY_EXIST
|
||||
#include <boost/test/unit_test.hpp>
|
||||
#else
|
||||
#define BOOST_TEST_NO_LIB
|
||||
#include <boost/test/included/unit_test.hpp>
|
||||
#endif
|
||||
#include <toml/parser.hpp>
|
||||
#include "test_parse_aux.hpp"
|
||||
|
||||
using namespace toml;
|
||||
using namespace detail;
|
||||
|
||||
BOOST_AUTO_TEST_CASE(test_boolean)
|
||||
{
|
||||
TOML11_TEST_PARSE_EQUAL(parse_boolean, "true", true);
|
||||
TOML11_TEST_PARSE_EQUAL(parse_boolean, "false", false);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(test_boolean_value)
|
||||
{
|
||||
TOML11_TEST_PARSE_EQUAL_VALUE( "true", toml::value( true));
|
||||
TOML11_TEST_PARSE_EQUAL_VALUE("false", toml::value(false));
|
||||
}
|
||||
Reference in New Issue
Block a user