mirror of
https://github.com/ToruNiina/toml11.git
synced 2024-12-03 17:11:04 +00:00
test: check ostream op for comment containers
This commit is contained in:
parent
28b3f7d6fb
commit
134475e292
@ -460,3 +460,19 @@ BOOST_AUTO_TEST_CASE(test_overwrite_comments)
|
||||
BOOST_TEST(u.as_integer() == 42);
|
||||
}
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(test_output_comments)
|
||||
{
|
||||
using value_type = toml::basic_value<toml::preserve_comments>;
|
||||
{
|
||||
const value_type v(42, {"comment1", "comment2"});
|
||||
std::ostringstream oss;
|
||||
oss << v.comments();
|
||||
|
||||
std::ostringstream ref;
|
||||
ref << "#comment1\n";
|
||||
ref << "#comment2\n";
|
||||
|
||||
BOOST_TEST(oss.str() == ref.str());
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user