move test for find to get_related

This commit is contained in:
ToruNiina
2018-12-13 01:30:06 +09:00
parent affa159c82
commit be1a310ae5
2 changed files with 55 additions and 98 deletions

View File

@@ -363,34 +363,3 @@ BOOST_AUTO_TEST_CASE(test_get_toml_offset_datetime)
}
}
BOOST_AUTO_TEST_CASE(test_find_and_get)
{
{
toml::value v(true);
bool thrown = false;
try
{
toml::get<toml::boolean>(v, "key");
}
catch(toml::type_error const& te)
{
thrown = true;
}
BOOST_CHECK(thrown);
}
{
toml::table v{{"num", 42}};
BOOST_CHECK_EQUAL(42, toml::get<int>(v, "num"));
toml::get<toml::integer>(v, "num") = 54;
BOOST_CHECK_EQUAL(54, toml::get<int>(v, "num"));
}
{
toml::value v = toml::table{{"num", 42}};
BOOST_CHECK_EQUAL(42, toml::get<int>(v, "num"));
toml::get<toml::integer>(v, "num") = 54;
BOOST_CHECK_EQUAL(54, toml::get<int>(v, "num"));
}
}