fix: add scope to the test case to flush

This commit is contained in:
ToruNiina
2019-02-13 19:26:52 +09:00
parent dd9319245e
commit 5e20a8ff16

View File

@@ -220,8 +220,10 @@ BOOST_AUTO_TEST_CASE(test_file_with_BOM)
"[table]\n" "[table]\n"
"key = \"value\"\n" "key = \"value\"\n"
); );
std::ofstream ofs("tmp.toml"); {
ofs << table; std::ofstream ofs("tmp.toml");
ofs << table;
}
const auto data = toml::parse("tmp.toml"); const auto data = toml::parse("tmp.toml");
BOOST_CHECK_EQUAL(toml::get <std::string>(data.at("key")), "value"); BOOST_CHECK_EQUAL(toml::get <std::string>(data.at("key")), "value");
@@ -247,8 +249,10 @@ BOOST_AUTO_TEST_CASE(test_file_with_BOM)
"[table]\r\n" "[table]\r\n"
"key = \"value\"\r\n" "key = \"value\"\r\n"
); );
std::ofstream ofs("tmp.toml"); {
ofs << table; std::ofstream ofs("tmp.toml");
ofs << table;
}
const auto data = toml::parse("tmp.toml"); const auto data = toml::parse("tmp.toml");
BOOST_CHECK_EQUAL(toml::get <std::string>(data.at("key")), "value"); BOOST_CHECK_EQUAL(toml::get <std::string>(data.at("key")), "value");