mirror of
https://github.com/ToruNiina/toml11.git
synced 2025-09-17 17:58:09 +08:00
fix: avoid auto-conversion while making test case
This commit is contained in:
@@ -250,8 +250,11 @@ BOOST_AUTO_TEST_CASE(test_file_with_BOM)
|
|||||||
"key = \"value\"\r\n"
|
"key = \"value\"\r\n"
|
||||||
);
|
);
|
||||||
{
|
{
|
||||||
std::ofstream ofs("tmp.toml");
|
// with text-mode, "\n" is converted to "\r\n" and the resulting
|
||||||
ofs << table;
|
// value will be "\r\r\n". To avoid the additional "\r", use binary
|
||||||
|
// mode.
|
||||||
|
std::ofstream ofs("tmp.toml", std::ios_base::binary);
|
||||||
|
ofs.write(table.data(), table.size());
|
||||||
}
|
}
|
||||||
const auto data = toml::parse("tmp.toml");
|
const auto data = toml::parse("tmp.toml");
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user