mirror of
https://github.com/ToruNiina/toml11.git
synced 2024-11-08 22:00:07 +00:00
test: add test for no-eof-newline cases
This commit is contained in:
parent
003bc16c1b
commit
c8ff302c94
@ -779,6 +779,22 @@ BOOST_AUTO_TEST_CASE(test_files_end_with_empty_lines)
|
||||
BOOST_TEST(toml::find<std::string>(toml::find(data, "table"), "key") == "value");
|
||||
}
|
||||
|
||||
// without newline
|
||||
{
|
||||
const std::string table(
|
||||
"key = \"value\"\n"
|
||||
"[table]\n"
|
||||
"key = \"value\"\n"
|
||||
"a = 0"
|
||||
);
|
||||
std::istringstream iss(table);
|
||||
const auto data = toml::parse(iss,
|
||||
"test_files_end_with_newline.toml");
|
||||
|
||||
BOOST_TEST(toml::find<std::string>(data, "key") == "value");
|
||||
BOOST_TEST(toml::find<std::string>(toml::find(data, "table"), "key") == "value");
|
||||
}
|
||||
|
||||
|
||||
// CRLF
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user