mirror of
https://github.com/ToruNiina/toml11.git
synced 2025-01-10 09:20:11 +00:00
test: add test for operator<<(os, non-table-value)
This commit is contained in:
parent
3624e4b690
commit
6182f3ee9d
@ -475,4 +475,15 @@ BOOST_AUTO_TEST_CASE(test_output_comments)
|
|||||||
|
|
||||||
BOOST_TEST(oss.str() == ref.str());
|
BOOST_TEST(oss.str() == ref.str());
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
const value_type v(42, {"comment1", "comment2"});
|
||||||
|
std::ostringstream oss;
|
||||||
|
|
||||||
|
// If v is not a table, toml11 assumes that user is writing something
|
||||||
|
// like the following.
|
||||||
|
|
||||||
|
oss << "answer = " << v;
|
||||||
|
|
||||||
|
BOOST_TEST(oss.str() == "answer = 42 #comment1comment2");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user