mirror of
https://github.com/ToruNiina/toml11.git
synced 2024-11-23 04:40:06 +00:00
fix: avoid auto-conversion while making test case
This commit is contained in:
parent
5e20a8ff16
commit
46569da231
@ -250,8 +250,11 @@ BOOST_AUTO_TEST_CASE(test_file_with_BOM)
|
||||
"key = \"value\"\r\n"
|
||||
);
|
||||
{
|
||||
std::ofstream ofs("tmp.toml");
|
||||
ofs << table;
|
||||
// with text-mode, "\n" is converted to "\r\n" and the resulting
|
||||
// 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");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user