From 2152c85cd17878f323751e829609b88c498029d7 Mon Sep 17 00:00:00 2001 From: ToruNiina Date: Fri, 10 Dec 2021 23:46:14 +0900 Subject: [PATCH] test: add test_file_ends_without_lf --- tests/test_parse_file.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/test_parse_file.cpp b/tests/test_parse_file.cpp index f6e4512..c2d3610 100644 --- a/tests/test_parse_file.cpp +++ b/tests/test_parse_file.cpp @@ -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(data, "key") == "value"); + BOOST_TEST(toml::find(toml::find(data, "table"), "key") == "value"); + } +} BOOST_AUTO_TEST_CASE(test_parse_function_compiles) {