mirror of
https://github.com/marzer/tomlplusplus.git
synced 2025-02-23 18:40:04 +00:00
also: - fixed column numbers being wrong when a value ended at EOF - fixed some `print_to_stream` overloads for `char8_t` - fixed a minor preprocessor snafu on MSVC - fixed '\' not being escaped when printing string values - added an initializer list constructor for tables - added `array::flatten` - added `table::find` - added `table::is_inline` setter - added `TOML_SMALL_INT_TYPE` - added `parse_file` - added stream operator for source_region - added proper license notice for the utf8 decoder - added lots more documentation and tests
18 lines
385 B
C++
18 lines
385 B
C++
#include "tests.h"
|
|
|
|
TEST_CASE("parsing - comments")
|
|
{
|
|
parsing_should_succeed(S(R"(
|
|
# This is a full-line comment
|
|
key = "value" # This is a comment at the end of a line
|
|
another = "# This is not a comment"
|
|
)"sv),
|
|
[](table&& tbl) noexcept
|
|
{
|
|
CHECK(tbl.size() == 2);
|
|
CHECK(tbl[S("key")] == S("value"sv));
|
|
CHECK(tbl[S("another")] == S("# This is not a comment"sv));
|
|
}
|
|
);
|
|
}
|