mirror of
https://github.com/ToruNiina/toml11.git
synced 2024-11-22 12:30:04 +00:00
test: add test for nocomment/showcomment
This commit is contained in:
parent
0502924d25
commit
937a3b4a2e
@ -486,4 +486,29 @@ BOOST_AUTO_TEST_CASE(test_output_comments)
|
||||
|
||||
BOOST_TEST(oss.str() == "answer = 42 #comment1comment2");
|
||||
}
|
||||
|
||||
{
|
||||
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 << toml::nocomment << "answer = " << v;
|
||||
|
||||
BOOST_TEST(oss.str() == "answer = 42");
|
||||
}
|
||||
|
||||
{
|
||||
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 << toml::nocomment << toml::showcomment << "answer = " << v;
|
||||
|
||||
BOOST_TEST(oss.str() == "answer = 42 #comment1comment2");
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user