From 5e20a8ff1636c6918931ff52ec3db01b7f41793c Mon Sep 17 00:00:00 2001 From: ToruNiina Date: Wed, 13 Feb 2019 19:26:52 +0900 Subject: [PATCH] fix: add scope to the test case to flush --- tests/test_parse_file.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/test_parse_file.cpp b/tests/test_parse_file.cpp index 66e9d7c..a38e9c9 100644 --- a/tests/test_parse_file.cpp +++ b/tests/test_parse_file.cpp @@ -220,8 +220,10 @@ BOOST_AUTO_TEST_CASE(test_file_with_BOM) "[table]\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"); BOOST_CHECK_EQUAL(toml::get (data.at("key")), "value"); @@ -247,8 +249,10 @@ BOOST_AUTO_TEST_CASE(test_file_with_BOM) "[table]\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"); BOOST_CHECK_EQUAL(toml::get (data.at("key")), "value");