fix: change CRLF into LF before comparison

This commit is contained in:
ToruNiina
2019-02-13 23:48:53 +09:00
parent 31193d99ba
commit ba8c205253

View File

@@ -17,7 +17,17 @@ BOOST_AUTO_TEST_CASE(test_example)
std::ofstream ofs("tmp1.toml");
ofs << data;
}
const auto serialized = toml::parse("tmp1.toml");
auto serialized = toml::parse("tmp1.toml");
{
auto& owner = toml::get<toml::table>(serialized.at("owner"));
auto& bio = toml::get<std::string>(owner.at("bio"));
const auto CR = std::find(bio.begin(), bio.end(), '\r');
if(CR != bio.end())
{
bio.erase(CR);
}
}
BOOST_CHECK(data == serialized);
}