tomlplusplus/tests/parsing_comments.cpp
Mark Gillard c7483cb92c added insertion operations for tables and arrays
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
2020-02-13 20:34:45 +02:00

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));
}
);
}