test: add test_file_ends_without_lf

This commit is contained in:
ToruNiina
2021-12-10 23:46:14 +09:00
parent 2e4c7fb95e
commit 2152c85cd1

View File

@@ -905,6 +905,22 @@ BOOST_AUTO_TEST_CASE(test_files_end_with_empty_lines)
}
}
BOOST_AUTO_TEST_CASE(test_file_ends_without_lf)
{
{
const std::string table(
"key = \"value\"\n"
"[table]\n"
"key = \"value\""
);
std::istringstream iss(table);
const auto data = toml::parse(iss,
"test_files_end_without_lf.toml");
BOOST_TEST(toml::find<std::string>(data, "key") == "value");
BOOST_TEST(toml::find<std::string>(toml::find(data, "table"), "key") == "value");
}
}
BOOST_AUTO_TEST_CASE(test_parse_function_compiles)
{