fix: remove CR before comparing to the reference

This commit is contained in:
ToruNiina
2019-06-29 15:38:28 +09:00
parent df0d870c97
commit 0fc0967f6f

View File

@@ -127,7 +127,16 @@ BOOST_AUTO_TEST_CASE(test_example_with_comment_nocomment)
}
{
const auto data_nocomment = toml::parse("toml/tests/example.toml");
const auto serialized = toml::parse("tmp1_com_nocomment.toml");
auto serialized = toml::parse("tmp1_com_nocomment.toml");
{
auto& owner = toml::find(serialized, "owner");
auto& bio = toml::find<std::string>(owner, "bio");
const auto CR = std::find(bio.begin(), bio.end(), '\r');
if(CR != bio.end())
{
bio.erase(CR);
}
}
// check collectly serialized
BOOST_TEST(data_nocomment == serialized);
}
@@ -173,7 +182,16 @@ BOOST_AUTO_TEST_CASE(test_example_with_comment_map_dq_nocomment)
}
{
const auto data_nocomment = toml::parse("toml/tests/example.toml");
const auto serialized = toml::parse("tmp1_com_map_dq_nocomment.toml");
auto serialized = toml::parse("tmp1_com_map_dq_nocomment.toml");
{
auto& owner = toml::find(serialized, "owner");
auto& bio = toml::find<std::string>(owner, "bio");
const auto CR = std::find(bio.begin(), bio.end(), '\r');
if(CR != bio.end())
{
bio.erase(CR);
}
}
BOOST_TEST(data_nocomment == serialized);
}
}