mirror of
https://github.com/ToruNiina/toml11.git
synced 2025-09-16 16:28:09 +08:00
refactor: remove template from detail::location
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
do { \
|
||||
const std::string token (tkn); \
|
||||
const std::string expected(expct); \
|
||||
toml::detail::location<std::string> loc("test", token); \
|
||||
toml::detail::location loc("test", token); \
|
||||
const auto result = lxr::invoke(loc); \
|
||||
BOOST_TEST(result.is_ok()); \
|
||||
if(result.is_ok()){ \
|
||||
@@ -28,7 +28,7 @@ do { \
|
||||
#define TOML11_TEST_LEX_REJECT(lxr, tkn) \
|
||||
do { \
|
||||
const std::string token (tkn); \
|
||||
toml::detail::location<std::string> loc("test", token); \
|
||||
toml::detail::location loc("test", token); \
|
||||
const auto result = lxr::invoke(loc); \
|
||||
BOOST_TEST(result.is_err()); \
|
||||
const bool loc_same = (loc.begin() == loc.iter()); \
|
||||
|
@@ -7,7 +7,7 @@
|
||||
#define TOML11_TEST_PARSE_EQUAL(psr, tkn, expct) \
|
||||
do { \
|
||||
const std::string token(tkn); \
|
||||
toml::detail::location<std::string> loc("test", token); \
|
||||
toml::detail::location loc("test", token); \
|
||||
const auto result = psr(loc); \
|
||||
BOOST_TEST(result.is_ok()); \
|
||||
if(result.is_ok()){ \
|
||||
@@ -23,7 +23,7 @@ do { \
|
||||
#define TOML11_TEST_PARSE_EQUAL_VALUE(psr, tkn, expct) \
|
||||
do { \
|
||||
const std::string token(tkn); \
|
||||
toml::detail::location<std::string> loc("test", token); \
|
||||
toml::detail::location loc("test", token); \
|
||||
const auto result = psr(loc); \
|
||||
BOOST_TEST(result.is_ok()); \
|
||||
if(result.is_ok()){ \
|
||||
|
@@ -128,7 +128,7 @@ BOOST_AUTO_TEST_CASE(test_inf)
|
||||
{
|
||||
{
|
||||
const std::string token("inf");
|
||||
toml::detail::location<std::string> loc("test", token);
|
||||
toml::detail::location loc("test", token);
|
||||
const auto r = parse_floating(loc);
|
||||
BOOST_CHECK(r.is_ok());
|
||||
BOOST_CHECK(std::isinf(r.unwrap().first));
|
||||
@@ -136,7 +136,7 @@ BOOST_AUTO_TEST_CASE(test_inf)
|
||||
}
|
||||
{
|
||||
const std::string token("+inf");
|
||||
toml::detail::location<std::string> loc("test", token);
|
||||
toml::detail::location loc("test", token);
|
||||
const auto r = parse_floating(loc);
|
||||
BOOST_CHECK(r.is_ok());
|
||||
BOOST_CHECK(std::isinf(r.unwrap().first));
|
||||
@@ -144,7 +144,7 @@ BOOST_AUTO_TEST_CASE(test_inf)
|
||||
}
|
||||
{
|
||||
const std::string token("-inf");
|
||||
toml::detail::location<std::string> loc("test", token);
|
||||
toml::detail::location loc("test", token);
|
||||
const auto r = parse_floating(loc);
|
||||
BOOST_CHECK(r.is_ok());
|
||||
BOOST_CHECK(std::isinf(r.unwrap().first));
|
||||
@@ -156,21 +156,21 @@ BOOST_AUTO_TEST_CASE(test_nan)
|
||||
{
|
||||
{
|
||||
const std::string token("nan");
|
||||
toml::detail::location<std::string> loc("test", token);
|
||||
toml::detail::location loc("test", token);
|
||||
const auto r = parse_floating(loc);
|
||||
BOOST_CHECK(r.is_ok());
|
||||
BOOST_CHECK(std::isnan(r.unwrap().first));
|
||||
}
|
||||
{
|
||||
const std::string token("+nan");
|
||||
toml::detail::location<std::string> loc("test", token);
|
||||
toml::detail::location loc("test", token);
|
||||
const auto r = parse_floating(loc);
|
||||
BOOST_CHECK(r.is_ok());
|
||||
BOOST_CHECK(std::isnan(r.unwrap().first));
|
||||
}
|
||||
{
|
||||
const std::string token("-nan");
|
||||
toml::detail::location<std::string> loc("test", token);
|
||||
toml::detail::location loc("test", token);
|
||||
const auto r = parse_floating(loc);
|
||||
BOOST_CHECK(r.is_ok());
|
||||
BOOST_CHECK(std::isnan(r.unwrap().first));
|
||||
|
@@ -19,7 +19,7 @@ BOOST_AUTO_TEST_CASE(test_normal_table)
|
||||
"key2 = 42\n"
|
||||
"key3 = 3.14\n"
|
||||
);
|
||||
location<std::string> loc("test", table);
|
||||
location loc("test", table);
|
||||
|
||||
const auto result = toml::detail::parse_ml_table<toml::value>(loc);
|
||||
BOOST_TEST(result.is_ok());
|
||||
@@ -36,7 +36,7 @@ BOOST_AUTO_TEST_CASE(test_nested_table)
|
||||
"a.b = \"value\"\n"
|
||||
"a.c.d = 42\n"
|
||||
);
|
||||
location<std::string> loc("test", table);
|
||||
location loc("test", table);
|
||||
|
||||
const auto result = toml::detail::parse_ml_table<toml::value>(loc);
|
||||
BOOST_TEST(result.is_ok());
|
||||
|
Reference in New Issue
Block a user