mirror of
https://github.com/ToruNiina/toml11.git
synced 2025-09-17 09:08:08 +08:00
test: update test codes to v4
This commit is contained in:
28
tests/test_syntax_boolean.cpp
Normal file
28
tests/test_syntax_boolean.cpp
Normal file
@@ -0,0 +1,28 @@
|
||||
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
|
||||
#include "doctest.h"
|
||||
|
||||
#include "utility.hpp"
|
||||
|
||||
#include <toml11/syntax.hpp>
|
||||
|
||||
TEST_CASE("testing boolean should success")
|
||||
{
|
||||
const auto scanner = toml::detail::syntax::boolean(toml::spec::v(1,0,0));
|
||||
|
||||
test_scan_success(scanner, "true", "true");
|
||||
test_scan_success(scanner, "false", "false");
|
||||
test_scan_success(scanner, "true # comment", "true");
|
||||
test_scan_success(scanner, "false # comment", "false");
|
||||
}
|
||||
|
||||
TEST_CASE("testing boolean should fail")
|
||||
{
|
||||
const auto scanner = toml::detail::syntax::boolean(toml::spec::v(1,0,0));
|
||||
|
||||
test_scan_failure(scanner, "TRUE");
|
||||
test_scan_failure(scanner, "FALSE");
|
||||
test_scan_failure(scanner, "True");
|
||||
test_scan_failure(scanner, "False");
|
||||
test_scan_failure(scanner, "T");
|
||||
test_scan_failure(scanner, "F");
|
||||
}
|
Reference in New Issue
Block a user