mirror of
https://github.com/marzer/tomlplusplus.git
synced 2024-09-04 14:09:11 +00:00
fixed an illegal table redefinition edge case (closes #112)
also: - fixed incorrect source position in redefinition error messages - updated conformance tests
This commit is contained in:
parent
037bfdd21f
commit
f3896b7474
2
external/toml-test
vendored
2
external/toml-test
vendored
@ -1 +1 @@
|
|||||||
Subproject commit 269931e74e3fef9d81729fe0f351f21f65cfce4b
|
Subproject commit 51f2e538628727ca749e10701aaf8d53a4d81bac
|
@ -51,7 +51,7 @@ TOML_ANON_NAMESPACE_START
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <uint64_t> struct parse_integer_traits;
|
template <uint64_t> struct parse_integer_traits;
|
||||||
template <> struct parse_integer_traits<2> final
|
template <> struct parse_integer_traits<2>
|
||||||
{
|
{
|
||||||
static constexpr auto scope_qualifier = "binary integer"sv;
|
static constexpr auto scope_qualifier = "binary integer"sv;
|
||||||
static constexpr auto is_digit = ::toml::impl::is_binary_digit;
|
static constexpr auto is_digit = ::toml::impl::is_binary_digit;
|
||||||
@ -60,7 +60,7 @@ TOML_ANON_NAMESPACE_START
|
|||||||
static constexpr auto prefix_codepoint = U'b';
|
static constexpr auto prefix_codepoint = U'b';
|
||||||
static constexpr auto prefix = "b"sv;
|
static constexpr auto prefix = "b"sv;
|
||||||
};
|
};
|
||||||
template <> struct parse_integer_traits<8> final
|
template <> struct parse_integer_traits<8>
|
||||||
{
|
{
|
||||||
static constexpr auto scope_qualifier = "octal integer"sv;
|
static constexpr auto scope_qualifier = "octal integer"sv;
|
||||||
static constexpr auto is_digit = ::toml::impl::is_octal_digit;
|
static constexpr auto is_digit = ::toml::impl::is_octal_digit;
|
||||||
@ -69,14 +69,14 @@ TOML_ANON_NAMESPACE_START
|
|||||||
static constexpr auto prefix_codepoint = U'o';
|
static constexpr auto prefix_codepoint = U'o';
|
||||||
static constexpr auto prefix = "o"sv;
|
static constexpr auto prefix = "o"sv;
|
||||||
};
|
};
|
||||||
template <> struct parse_integer_traits<10> final
|
template <> struct parse_integer_traits<10>
|
||||||
{
|
{
|
||||||
static constexpr auto scope_qualifier = "decimal integer"sv;
|
static constexpr auto scope_qualifier = "decimal integer"sv;
|
||||||
static constexpr auto is_digit = ::toml::impl::is_decimal_digit;
|
static constexpr auto is_digit = ::toml::impl::is_decimal_digit;
|
||||||
static constexpr auto is_signed = true;
|
static constexpr auto is_signed = true;
|
||||||
static constexpr auto buffer_length = 19; //strlen("9223372036854775807")
|
static constexpr auto buffer_length = 19; //strlen("9223372036854775807")
|
||||||
};
|
};
|
||||||
template <> struct parse_integer_traits<16> final
|
template <> struct parse_integer_traits<16>
|
||||||
{
|
{
|
||||||
static constexpr auto scope_qualifier = "hexadecimal integer"sv;
|
static constexpr auto scope_qualifier = "hexadecimal integer"sv;
|
||||||
static constexpr auto is_digit = ::toml::impl::is_hexadecimal_digit;
|
static constexpr auto is_digit = ::toml::impl::is_hexadecimal_digit;
|
||||||
@ -198,7 +198,7 @@ TOML_ANON_NAMESPACE_START
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
struct error_builder final
|
struct error_builder
|
||||||
{
|
{
|
||||||
static constexpr std::size_t buf_size = 512;
|
static constexpr std::size_t buf_size = 512;
|
||||||
char buf[buf_size];
|
char buf[buf_size];
|
||||||
@ -242,7 +242,7 @@ TOML_ANON_NAMESPACE_START
|
|||||||
error_builder& operator=(error_builder&&) = delete;
|
error_builder& operator=(error_builder&&) = delete;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct parse_scope final
|
struct parse_scope
|
||||||
{
|
{
|
||||||
std::string_view& storage_;
|
std::string_view& storage_;
|
||||||
std::string_view parent_;
|
std::string_view parent_;
|
||||||
@ -330,18 +330,19 @@ TOML_ANON_NAMESPACE_START
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct parsed_key final
|
struct parsed_key
|
||||||
{
|
{
|
||||||
|
toml::source_position position;
|
||||||
std::vector<std::string> segments;
|
std::vector<std::string> segments;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct parsed_key_value_pair final
|
struct parsed_key_value_pair
|
||||||
{
|
{
|
||||||
parsed_key key;
|
parsed_key key;
|
||||||
node_ptr value;
|
node_ptr value;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct parse_depth_counter final
|
struct parse_depth_counter
|
||||||
{
|
{
|
||||||
size_t& depth_;
|
size_t& depth_;
|
||||||
|
|
||||||
@ -363,6 +364,11 @@ TOML_ANON_NAMESPACE_START
|
|||||||
parse_depth_counter& operator=(parse_depth_counter&&) = delete;
|
parse_depth_counter& operator=(parse_depth_counter&&) = delete;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct parsed_string
|
||||||
|
{
|
||||||
|
std::string value;
|
||||||
|
bool was_multi_line;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
TOML_ANON_NAMESPACE_END;
|
TOML_ANON_NAMESPACE_END;
|
||||||
|
|
||||||
@ -389,8 +395,8 @@ TOML_IMPL_NAMESPACE_START
|
|||||||
#if TOML_EXCEPTIONS
|
#if TOML_EXCEPTIONS
|
||||||
#define is_error() false
|
#define is_error() false
|
||||||
#define return_after_error(...) TOML_UNREACHABLE
|
#define return_after_error(...) TOML_UNREACHABLE
|
||||||
#define assert_not_error() (void)0
|
#define assert_not_error() static_assert(true)
|
||||||
#define return_if_error(...) (void)0
|
#define return_if_error(...) static_assert(true)
|
||||||
#define return_if_error_or_eof(...) return_if_eof(__VA_ARGS__)
|
#define return_if_error_or_eof(...) return_if_eof(__VA_ARGS__)
|
||||||
#else
|
#else
|
||||||
#define is_error() !!err
|
#define is_error() !!err
|
||||||
@ -400,6 +406,25 @@ TOML_IMPL_NAMESPACE_START
|
|||||||
#define return_if_error_or_eof(...) do { if (is_eof() || is_error()) return __VA_ARGS__; } while(false)
|
#define return_if_error_or_eof(...) do { if (is_eof() || is_error()) return __VA_ARGS__; } while(false)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(TOML_BREAK_AT_PARSE_ERRORS) && TOML_BREAK_AT_PARSE_ERRORS
|
||||||
|
#if defined(__has_builtin)
|
||||||
|
#if __has_builtin(__builtin_debugtrap)
|
||||||
|
#define parse_error_break() __builtin_debugtrap()
|
||||||
|
#elif __has_builtin(__debugbreak)
|
||||||
|
#define parse_error_break() __debugbreak()
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#ifndef parse_error_break
|
||||||
|
#if TOML_MSVC || TOML_ICC
|
||||||
|
#define parse_error_break() __debugbreak()
|
||||||
|
#else
|
||||||
|
#define parse_error_break() TOML_ASSERT(false)
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
#define parse_error_break() static_assert(true)
|
||||||
|
#endif
|
||||||
|
|
||||||
#define set_error_and_return(ret, ...) \
|
#define set_error_and_return(ret, ...) \
|
||||||
do { if (!is_error()) set_error(__VA_ARGS__); return_after_error(ret); } while(false)
|
do { if (!is_error()) set_error(__VA_ARGS__); return_after_error(ret); } while(false)
|
||||||
|
|
||||||
@ -421,7 +446,7 @@ TOML_IMPL_NAMESPACE_START
|
|||||||
|
|
||||||
TOML_ABI_NAMESPACE_BOOL(TOML_EXCEPTIONS, ex, noex);
|
TOML_ABI_NAMESPACE_BOOL(TOML_EXCEPTIONS, ex, noex);
|
||||||
|
|
||||||
class parser final
|
class parser
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
static constexpr size_t max_nested_values = TOML_MAX_NESTED_VALUES;
|
static constexpr size_t max_nested_values = TOML_MAX_NESTED_VALUES;
|
||||||
@ -463,6 +488,8 @@ TOML_IMPL_NAMESPACE_START
|
|||||||
error_builder builder{ current_scope };
|
error_builder builder{ current_scope };
|
||||||
(builder.append(reason), ...);
|
(builder.append(reason), ...);
|
||||||
|
|
||||||
|
parse_error_break();
|
||||||
|
|
||||||
#if TOML_EXCEPTIONS
|
#if TOML_EXCEPTIONS
|
||||||
builder.finish(pos, reader.source_path());
|
builder.finish(pos, reader.source_path());
|
||||||
#else
|
#else
|
||||||
@ -1031,12 +1058,6 @@ TOML_IMPL_NAMESPACE_START
|
|||||||
set_error_and_return_default("encountered end-of-file"sv);
|
set_error_and_return_default("encountered end-of-file"sv);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct parsed_string final
|
|
||||||
{
|
|
||||||
std::string value;
|
|
||||||
bool was_multi_line;
|
|
||||||
};
|
|
||||||
|
|
||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
TOML_NEVER_INLINE
|
TOML_NEVER_INLINE
|
||||||
parsed_string parse_string() TOML_MAY_THROW
|
parsed_string parse_string() TOML_MAY_THROW
|
||||||
@ -2427,6 +2448,7 @@ TOML_IMPL_NAMESPACE_START
|
|||||||
push_parse_scope("key"sv);
|
push_parse_scope("key"sv);
|
||||||
|
|
||||||
parsed_key key;
|
parsed_key key;
|
||||||
|
key.position = current_position();
|
||||||
recording_whitespace = false;
|
recording_whitespace = false;
|
||||||
|
|
||||||
while (!is_error())
|
while (!is_error())
|
||||||
@ -2528,7 +2550,7 @@ TOML_IMPL_NAMESPACE_START
|
|||||||
assert_or_assume(*cp == U'[');
|
assert_or_assume(*cp == U'[');
|
||||||
push_parse_scope("table header"sv);
|
push_parse_scope("table header"sv);
|
||||||
|
|
||||||
const auto header_begin_pos = cp->position;
|
const source_position header_begin_pos = cp->position;
|
||||||
source_position header_end_pos;
|
source_position header_end_pos;
|
||||||
parsed_key key;
|
parsed_key key;
|
||||||
bool is_arr = false;
|
bool is_arr = false;
|
||||||
@ -2687,7 +2709,7 @@ TOML_IMPL_NAMESPACE_START
|
|||||||
&& !implicit_tables.empty())
|
&& !implicit_tables.empty())
|
||||||
{
|
{
|
||||||
auto tbl = &matching_node->ref_cast<table>();
|
auto tbl = &matching_node->ref_cast<table>();
|
||||||
if (auto found = find(implicit_tables, tbl))
|
if (auto found = find(implicit_tables, tbl); found && (tbl->empty() || tbl->is_homogeneous<table>()))
|
||||||
{
|
{
|
||||||
implicit_tables.erase(implicit_tables.cbegin() + (found - implicit_tables.data()));
|
implicit_tables.erase(implicit_tables.cbegin() + (found - implicit_tables.data()));
|
||||||
tbl->source_.begin = header_begin_pos;
|
tbl->source_.begin = header_begin_pos;
|
||||||
@ -2698,13 +2720,19 @@ TOML_IMPL_NAMESPACE_START
|
|||||||
|
|
||||||
//if we get here it's a redefinition error.
|
//if we get here it's a redefinition error.
|
||||||
if (!is_arr && matching_node->type() == node_type::table)
|
if (!is_arr && matching_node->type() == node_type::table)
|
||||||
set_error_and_return_default("cannot redefine existing table '"sv, to_sv(recording_buffer), "'"sv);
|
{
|
||||||
|
set_error_at(header_begin_pos, "cannot redefine existing table '"sv, to_sv(recording_buffer), "'"sv);
|
||||||
|
return_after_error({});
|
||||||
|
}
|
||||||
else
|
else
|
||||||
set_error_and_return_default(
|
{
|
||||||
|
set_error_at(header_begin_pos,
|
||||||
"cannot redefine existing "sv, to_sv(matching_node->type()),
|
"cannot redefine existing "sv, to_sv(matching_node->type()),
|
||||||
" '"sv, to_sv(recording_buffer),
|
" '"sv, to_sv(recording_buffer),
|
||||||
"' as "sv, is_arr ? "array-of-tables"sv : "table"sv
|
"' as "sv, is_arr ? "array-of-tables"sv : "table"sv
|
||||||
);
|
);
|
||||||
|
return_after_error({});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2735,9 +2763,11 @@ TOML_IMPL_NAMESPACE_START
|
|||||||
dotted_key_tables.push_back(&child->ref_cast<table>());
|
dotted_key_tables.push_back(&child->ref_cast<table>());
|
||||||
child->source_ = kvp.value.get()->source_;
|
child->source_ = kvp.value.get()->source_;
|
||||||
}
|
}
|
||||||
else if (!child->is_table()
|
else if (!child->is_table() || !(
|
||||||
|| !(find(dotted_key_tables, &child->ref_cast<table>()) || find(implicit_tables, &child->ref_cast<table>())))
|
find(dotted_key_tables, &child->ref_cast<table>())
|
||||||
set_error("cannot redefine existing "sv, to_sv(child->type()), " as dotted key-value pair"sv);
|
|| find(implicit_tables, &child->ref_cast<table>())
|
||||||
|
))
|
||||||
|
set_error_at(kvp.key.position, "cannot redefine existing "sv, to_sv(child->type()), " as dotted key-value pair"sv);
|
||||||
else
|
else
|
||||||
child->source_.end = kvp.value.get()->source_.end;
|
child->source_.end = kvp.value.get()->source_.end;
|
||||||
|
|
||||||
@ -3135,6 +3165,7 @@ TOML_IMPL_NAMESPACE_START
|
|||||||
#undef advance_and_return_if_error
|
#undef advance_and_return_if_error
|
||||||
#undef advance_and_return_if_error_or_eof
|
#undef advance_and_return_if_error_or_eof
|
||||||
#undef assert_or_assume
|
#undef assert_or_assume
|
||||||
|
#undef parse_error_break
|
||||||
}
|
}
|
||||||
TOML_IMPL_NAMESPACE_END;
|
TOML_IMPL_NAMESPACE_END;
|
||||||
|
|
||||||
|
@ -17,11 +17,11 @@ namespace
|
|||||||
static constexpr auto array_no_close_table_2 = R"(x = [{ key = 42 #)"sv;
|
static constexpr auto array_no_close_table_2 = R"(x = [{ key = 42 #)"sv;
|
||||||
static constexpr auto array_no_close_table = R"(x = [{ key = 42)"sv;
|
static constexpr auto array_no_close_table = R"(x = [{ key = 42)"sv;
|
||||||
static constexpr auto array_no_close = R"(long_array = [ 1, 2, 3)"sv;
|
static constexpr auto array_no_close = R"(long_array = [ 1, 2, 3)"sv;
|
||||||
static constexpr auto array_of_tables_1 = R"(# INVALID TOML DOC
|
static constexpr auto array_tables_1 = R"(# INVALID TOML DOC
|
||||||
fruit = []
|
fruit = []
|
||||||
|
|
||||||
[[fruit]] # Not allowed)"sv;
|
[[fruit]] # Not allowed)"sv;
|
||||||
static constexpr auto array_of_tables_2 = R"(# INVALID TOML DOC
|
static constexpr auto array_tables_2 = R"(# INVALID TOML DOC
|
||||||
[[fruit]]
|
[[fruit]]
|
||||||
name = "apple"
|
name = "apple"
|
||||||
|
|
||||||
@ -31,6 +31,19 @@ fruit = []
|
|||||||
# This table conflicts with the previous table
|
# This table conflicts with the previous table
|
||||||
[fruit.variety]
|
[fruit.variety]
|
||||||
name = "granny smith")"sv;
|
name = "granny smith")"sv;
|
||||||
|
static constexpr auto array_text_after_array_entries = R"(array = [
|
||||||
|
"Is there life after an array separator?", No
|
||||||
|
"Entry"
|
||||||
|
])"sv;
|
||||||
|
static constexpr auto array_text_before_array_separator = R"(array = [
|
||||||
|
"Is there life before an array separator?" No,
|
||||||
|
"Entry"
|
||||||
|
])"sv;
|
||||||
|
static constexpr auto array_text_in_array = R"(array = [
|
||||||
|
"Entry 1",
|
||||||
|
I don't belong,
|
||||||
|
"Entry 2",
|
||||||
|
])"sv;
|
||||||
|
|
||||||
static constexpr auto bool_mixed_case = R"(valid = False)"sv;
|
static constexpr auto bool_mixed_case = R"(valid = False)"sv;
|
||||||
static constexpr auto bool_wrong_case_false = R"(b = FALSE)"sv;
|
static constexpr auto bool_wrong_case_false = R"(b = FALSE)"sv;
|
||||||
@ -48,23 +61,6 @@ fruit = []
|
|||||||
|
|
||||||
#endif // !TOML_LANG_UNRELEASED
|
#endif // !TOML_LANG_UNRELEASED
|
||||||
|
|
||||||
static constexpr auto duplicate_key_table = R"([fruit]
|
|
||||||
type = "apple"
|
|
||||||
|
|
||||||
[fruit.type]
|
|
||||||
apple = "yes")"sv;
|
|
||||||
static constexpr auto duplicate_keys = R"(dupe = false
|
|
||||||
dupe = true)"sv;
|
|
||||||
static constexpr auto duplicate_table_array = R"([tbl]
|
|
||||||
[[tbl]])"sv;
|
|
||||||
static constexpr auto duplicate_table_array2 = R"([[tbl]]
|
|
||||||
[tbl])"sv;
|
|
||||||
static constexpr auto duplicate_tables = R"([a]
|
|
||||||
[a])"sv;
|
|
||||||
|
|
||||||
static constexpr auto empty_implicit_table = R"([naughty..naughty])"sv;
|
|
||||||
static constexpr auto empty_table = R"([])"sv;
|
|
||||||
|
|
||||||
static constexpr auto float_double_point_1 = R"(double-point-1 = 0..1)"sv;
|
static constexpr auto float_double_point_1 = R"(double-point-1 = 0..1)"sv;
|
||||||
static constexpr auto float_double_point_2 = R"(double-point-2 = 0.1.2)"sv;
|
static constexpr auto float_double_point_2 = R"(double-point-2 = 0.1.2)"sv;
|
||||||
static constexpr auto float_exp_double_e_1 = R"(exp-double-e-1 = 1ee2)"sv;
|
static constexpr auto float_exp_double_e_1 = R"(exp-double-e-1 = 1ee2)"sv;
|
||||||
@ -110,6 +106,10 @@ simple = { a = 1
|
|||||||
b=2})"sv;
|
b=2})"sv;
|
||||||
static constexpr auto inline_table_linebreak_3 = R"(t = {a=1
|
static constexpr auto inline_table_linebreak_3 = R"(t = {a=1
|
||||||
,b=2})"sv;
|
,b=2})"sv;
|
||||||
|
static constexpr auto inline_table_linebreak_4 = R"(json_like = {
|
||||||
|
first = "Tom",
|
||||||
|
last = "Preston-Werner"
|
||||||
|
})"sv;
|
||||||
static constexpr auto inline_table_trailing_comma = R"(# A terminating comma (also called trailing comma) is not permitted after the
|
static constexpr auto inline_table_trailing_comma = R"(# A terminating comma (also called trailing comma) is not permitted after the
|
||||||
# last key/value pair in an inline table
|
# last key/value pair in an inline table
|
||||||
abc = { abc = 123, })"sv;
|
abc = { abc = 123, })"sv;
|
||||||
@ -139,6 +139,7 @@ abc = { abc = 123, })"sv;
|
|||||||
static constexpr auto integer_positive_bin = R"(positive-bin = +0b11010110)"sv;
|
static constexpr auto integer_positive_bin = R"(positive-bin = +0b11010110)"sv;
|
||||||
static constexpr auto integer_positive_hex = R"(positive-hex = +0xff)"sv;
|
static constexpr auto integer_positive_hex = R"(positive-hex = +0xff)"sv;
|
||||||
static constexpr auto integer_positive_oct = R"(positive-oct = +0o99)"sv;
|
static constexpr auto integer_positive_oct = R"(positive-oct = +0o99)"sv;
|
||||||
|
static constexpr auto integer_text_after_integer = R"(answer = 42 the ultimate answer?)"sv;
|
||||||
static constexpr auto integer_trailing_us_bin = R"(trailing-us-bin = 0b1_)"sv;
|
static constexpr auto integer_trailing_us_bin = R"(trailing-us-bin = 0b1_)"sv;
|
||||||
static constexpr auto integer_trailing_us_hex = R"(trailing-us-hex = 0x1_)"sv;
|
static constexpr auto integer_trailing_us_hex = R"(trailing-us-hex = 0x1_)"sv;
|
||||||
static constexpr auto integer_trailing_us_oct = R"(trailing-us-oct = 0o1_)"sv;
|
static constexpr auto integer_trailing_us_oct = R"(trailing-us-oct = 0o1_)"sv;
|
||||||
@ -155,6 +156,8 @@ abc = { abc = 123, })"sv;
|
|||||||
a.b = 1
|
a.b = 1
|
||||||
# Tries to access it as table: error
|
# Tries to access it as table: error
|
||||||
a.b.c = 2)"sv;
|
a.b.c = 2)"sv;
|
||||||
|
static constexpr auto key_duplicate_keys = R"(dupe = false
|
||||||
|
dupe = true)"sv;
|
||||||
static constexpr auto key_duplicate = R"(# DO NOT DO THIS
|
static constexpr auto key_duplicate = R"(# DO NOT DO THIS
|
||||||
name = "Tom"
|
name = "Tom"
|
||||||
name = "Pradyun")"sv;
|
name = "Pradyun")"sv;
|
||||||
@ -185,23 +188,6 @@ key""" = 1)"sv;
|
|||||||
|
|
||||||
#endif // !TOML_LANG_UNRELEASED && UNICODE_LITERALS_OK
|
#endif // !TOML_LANG_UNRELEASED && UNICODE_LITERALS_OK
|
||||||
|
|
||||||
static constexpr auto llbrace = R"([ [table]])"sv;
|
|
||||||
|
|
||||||
#if !TOML_LANG_UNRELEASED
|
|
||||||
|
|
||||||
static constexpr auto multi_line_inline_table = R"(json_like = {
|
|
||||||
first = "Tom",
|
|
||||||
last = "Preston-Werner"
|
|
||||||
})"sv;
|
|
||||||
|
|
||||||
#endif // !TOML_LANG_UNRELEASED
|
|
||||||
|
|
||||||
static constexpr auto multi_line_string_no_close_2 = R"(x=""")"sv;
|
|
||||||
static constexpr auto multi_line_string_no_close = R"(invalid = """
|
|
||||||
this will fail)"sv;
|
|
||||||
|
|
||||||
static constexpr auto rrbrace = R"([[table] ])"sv;
|
|
||||||
|
|
||||||
static constexpr auto string_bad_byte_escape = R"(naughty = "\xAg")"sv;
|
static constexpr auto string_bad_byte_escape = R"(naughty = "\xAg")"sv;
|
||||||
static constexpr auto string_bad_codepoint = R"(invalid-codepoint = "This string contains a non scalar unicode codepoint \uD801")"sv;
|
static constexpr auto string_bad_codepoint = R"(invalid-codepoint = "This string contains a non scalar unicode codepoint \uD801")"sv;
|
||||||
static constexpr auto string_bad_concat = R"(no_concat = "first" "second")"sv;
|
static constexpr auto string_bad_concat = R"(no_concat = "first" "second")"sv;
|
||||||
@ -223,9 +209,13 @@ second line")"sv;
|
|||||||
static constexpr auto string_multiline_escape_space = R"(a = """
|
static constexpr auto string_multiline_escape_space = R"(a = """
|
||||||
foo \ \n
|
foo \ \n
|
||||||
bar""")"sv;
|
bar""")"sv;
|
||||||
|
static constexpr auto string_multiline_no_close_2 = R"(x=""")"sv;
|
||||||
|
static constexpr auto string_multiline_no_close = R"(invalid = """
|
||||||
|
this will fail)"sv;
|
||||||
static constexpr auto string_multiline_quotes_1 = R"(a = """6 quotes: """""")"sv;
|
static constexpr auto string_multiline_quotes_1 = R"(a = """6 quotes: """""")"sv;
|
||||||
static constexpr auto string_multiline_quotes_2 = R"(a = """6 quotes: """""")"sv;
|
static constexpr auto string_multiline_quotes_2 = R"(a = """6 quotes: """""")"sv;
|
||||||
static constexpr auto string_no_close = R"(no-ending-quote = "One time, at band camp)"sv;
|
static constexpr auto string_no_close = R"(no-ending-quote = "One time, at band camp)"sv;
|
||||||
|
static constexpr auto string_text_after_string = R"(string = "Is there life after strings?" No.)"sv;
|
||||||
static constexpr auto string_wrong_close = R"(bad-ending-quote = "double and single')"sv;
|
static constexpr auto string_wrong_close = R"(bad-ending-quote = "double and single')"sv;
|
||||||
|
|
||||||
#if !TOML_LANG_UNRELEASED
|
#if !TOML_LANG_UNRELEASED
|
||||||
@ -252,13 +242,24 @@ name = "Glory Days"
|
|||||||
name = "Born in the USA")"sv;
|
name = "Born in the USA")"sv;
|
||||||
static constexpr auto table_array_missing_bracket = R"([[albums]
|
static constexpr auto table_array_missing_bracket = R"([[albums]
|
||||||
name = "Born to Run")"sv;
|
name = "Born to Run")"sv;
|
||||||
|
static constexpr auto table_duplicate_key_table = R"([fruit]
|
||||||
|
type = "apple"
|
||||||
|
|
||||||
|
[fruit.type]
|
||||||
|
apple = "yes")"sv;
|
||||||
|
static constexpr auto table_duplicate_table_array = R"([tbl]
|
||||||
|
[[tbl]])"sv;
|
||||||
|
static constexpr auto table_duplicate_table_array2 = R"([[tbl]]
|
||||||
|
[tbl])"sv;
|
||||||
static constexpr auto table_duplicate = R"([a]
|
static constexpr auto table_duplicate = R"([a]
|
||||||
b = 1
|
b = 1
|
||||||
|
|
||||||
[a]
|
[a]
|
||||||
c = 2)"sv;
|
c = 2)"sv;
|
||||||
|
static constexpr auto table_empty_implicit_table = R"([naughty..naughty])"sv;
|
||||||
static constexpr auto table_empty = R"([])"sv;
|
static constexpr auto table_empty = R"([])"sv;
|
||||||
static constexpr auto table_equals_sign = R"([name=bad])"sv;
|
static constexpr auto table_equals_sign = R"([name=bad])"sv;
|
||||||
|
static constexpr auto table_llbrace = R"([ [table]])"sv;
|
||||||
static constexpr auto table_nested_brackets_close = R"([a]b]
|
static constexpr auto table_nested_brackets_close = R"([a]b]
|
||||||
zyx = 42)"sv;
|
zyx = 42)"sv;
|
||||||
static constexpr auto table_nested_brackets_open = R"([a[b]
|
static constexpr auto table_nested_brackets_open = R"([a[b]
|
||||||
@ -271,368 +272,345 @@ b = 1
|
|||||||
|
|
||||||
[a.b]
|
[a.b]
|
||||||
c = 2)"sv;
|
c = 2)"sv;
|
||||||
|
static constexpr auto table_rrbrace = R"([[table] ])"sv;
|
||||||
|
static constexpr auto table_text_after_table = R"([error] this shouldn't be here)"sv;
|
||||||
static constexpr auto table_whitespace = R"([invalid key])"sv;
|
static constexpr auto table_whitespace = R"([invalid key])"sv;
|
||||||
static constexpr auto table_with_pound = R"([key#group]
|
static constexpr auto table_with_pound = R"([key#group]
|
||||||
answer = 42)"sv;
|
answer = 42)"sv;
|
||||||
|
|
||||||
static constexpr auto text_after_array_entries = R"(array = [
|
|
||||||
"Is there life after an array separator?", No
|
|
||||||
"Entry"
|
|
||||||
])"sv;
|
|
||||||
static constexpr auto text_after_integer = R"(answer = 42 the ultimate answer?)"sv;
|
|
||||||
static constexpr auto text_after_string = R"(string = "Is there life after strings?" No.)"sv;
|
|
||||||
static constexpr auto text_after_table = R"([error] this shouldn't be here)"sv;
|
|
||||||
static constexpr auto text_before_array_separator = R"(array = [
|
|
||||||
"Is there life before an array separator?" No,
|
|
||||||
"Entry"
|
|
||||||
])"sv;
|
|
||||||
static constexpr auto text_in_array = R"(array = [
|
|
||||||
"Entry 1",
|
|
||||||
I don't belong,
|
|
||||||
"Entry 2",
|
|
||||||
])"sv;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TOML_ENABLE_WARNINGS;
|
TOML_ENABLE_WARNINGS;
|
||||||
|
|
||||||
TEST_CASE("conformance - burntsushi/invalid")
|
TEST_CASE("conformance - burntsushi/invalid")
|
||||||
{
|
{
|
||||||
parsing_should_fail(FILE_LINE_ARGS, array_missing_separator);
|
parsing_should_fail(FILE_LINE_ARGS, array_missing_separator); // array-missing-separator
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, array_no_close_2);
|
parsing_should_fail(FILE_LINE_ARGS, array_no_close_2); // array-no-close-2
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, array_no_close_table_2);
|
parsing_should_fail(FILE_LINE_ARGS, array_no_close_table_2); // array-no-close-table-2
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, array_no_close_table);
|
parsing_should_fail(FILE_LINE_ARGS, array_no_close_table); // array-no-close-table
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, array_no_close);
|
parsing_should_fail(FILE_LINE_ARGS, array_no_close); // array-no-close
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, array_of_tables_1);
|
parsing_should_fail(FILE_LINE_ARGS, array_tables_1); // array-tables-1
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, array_of_tables_2);
|
parsing_should_fail(FILE_LINE_ARGS, array_tables_2); // array-tables-2
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, bool_mixed_case);
|
parsing_should_fail(FILE_LINE_ARGS, array_text_after_array_entries); // array-text-after-array-entries
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, bool_wrong_case_false);
|
parsing_should_fail(FILE_LINE_ARGS, array_text_before_array_separator); // array-text-before-array-separator
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, bool_wrong_case_true);
|
parsing_should_fail(FILE_LINE_ARGS, array_text_in_array); // array-text-in-array
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, datetime_impossible_date);
|
parsing_should_fail(FILE_LINE_ARGS, bool_mixed_case); // bool-mixed-case
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, datetime_no_leads_with_milli);
|
parsing_should_fail(FILE_LINE_ARGS, bool_wrong_case_false); // bool-wrong-case-false
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, datetime_no_leads);
|
parsing_should_fail(FILE_LINE_ARGS, bool_wrong_case_true); // bool-wrong-case-true
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, datetime_no_t);
|
parsing_should_fail(FILE_LINE_ARGS, datetime_impossible_date); // datetime-impossible-date
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, datetime_trailing_t);
|
parsing_should_fail(FILE_LINE_ARGS, datetime_no_leads_with_milli); // datetime-no-leads-with-milli
|
||||||
|
|
||||||
|
parsing_should_fail(FILE_LINE_ARGS, datetime_no_leads); // datetime-no-leads
|
||||||
|
|
||||||
|
parsing_should_fail(FILE_LINE_ARGS, datetime_no_t); // datetime-no-t
|
||||||
|
|
||||||
|
parsing_should_fail(FILE_LINE_ARGS, datetime_trailing_t); // datetime-trailing-t
|
||||||
|
|
||||||
#if !TOML_LANG_UNRELEASED
|
#if !TOML_LANG_UNRELEASED
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, datetime_no_secs);
|
parsing_should_fail(FILE_LINE_ARGS, datetime_no_secs); // datetime-no-secs
|
||||||
|
|
||||||
#endif // !TOML_LANG_UNRELEASED
|
#endif // !TOML_LANG_UNRELEASED
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, duplicate_key_table);
|
parsing_should_fail(FILE_LINE_ARGS, float_double_point_1); // float-double-point-1
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, duplicate_keys);
|
parsing_should_fail(FILE_LINE_ARGS, float_double_point_2); // float-double-point-2
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, duplicate_table_array);
|
parsing_should_fail(FILE_LINE_ARGS, float_exp_double_e_1); // float-exp-double-e-1
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, duplicate_table_array2);
|
parsing_should_fail(FILE_LINE_ARGS, float_exp_double_e_2); // float-exp-double-e-2
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, duplicate_tables);
|
parsing_should_fail(FILE_LINE_ARGS, float_exp_double_us); // float-exp-double-us
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, empty_implicit_table);
|
parsing_should_fail(FILE_LINE_ARGS, float_exp_leading_us); // float-exp-leading-us
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, empty_table);
|
parsing_should_fail(FILE_LINE_ARGS, float_exp_point_1); // float-exp-point-1
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, float_double_point_1);
|
parsing_should_fail(FILE_LINE_ARGS, float_exp_point_2); // float-exp-point-2
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, float_double_point_2);
|
parsing_should_fail(FILE_LINE_ARGS, float_exp_trailing_us); // float-exp-trailing-us
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, float_exp_double_e_1);
|
parsing_should_fail(FILE_LINE_ARGS, float_inf_incomplete_1); // float-inf-incomplete-1
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, float_exp_double_e_2);
|
parsing_should_fail(FILE_LINE_ARGS, float_inf_incomplete_2); // float-inf-incomplete-2
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, float_exp_double_us);
|
parsing_should_fail(FILE_LINE_ARGS, float_inf_incomplete_3); // float-inf-incomplete-3
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, float_exp_leading_us);
|
parsing_should_fail(FILE_LINE_ARGS, float_inf_underscore); // float-inf_underscore
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, float_exp_point_1);
|
parsing_should_fail(FILE_LINE_ARGS, float_leading_point_neg); // float-leading-point-neg
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, float_exp_point_2);
|
parsing_should_fail(FILE_LINE_ARGS, float_leading_point_plus); // float-leading-point-plus
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, float_exp_trailing_us);
|
parsing_should_fail(FILE_LINE_ARGS, float_leading_point); // float-leading-point
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, float_inf_incomplete_1);
|
parsing_should_fail(FILE_LINE_ARGS, float_leading_us); // float-leading-us
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, float_inf_incomplete_2);
|
parsing_should_fail(FILE_LINE_ARGS, float_leading_zero_neg); // float-leading-zero-neg
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, float_inf_incomplete_3);
|
parsing_should_fail(FILE_LINE_ARGS, float_leading_zero_plus); // float-leading-zero-plus
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, float_inf_underscore);
|
parsing_should_fail(FILE_LINE_ARGS, float_leading_zero); // float-leading-zero
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, float_leading_point_neg);
|
parsing_should_fail(FILE_LINE_ARGS, float_nan_incomplete_1); // float-nan-incomplete-1
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, float_leading_point_plus);
|
parsing_should_fail(FILE_LINE_ARGS, float_nan_incomplete_2); // float-nan-incomplete-2
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, float_leading_point);
|
parsing_should_fail(FILE_LINE_ARGS, float_nan_incomplete_3); // float-nan-incomplete-3
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, float_leading_us);
|
parsing_should_fail(FILE_LINE_ARGS, float_nan_underscore); // float-nan_underscore
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, float_leading_zero_neg);
|
parsing_should_fail(FILE_LINE_ARGS, float_trailing_point_min); // float-trailing-point-min
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, float_leading_zero_plus);
|
parsing_should_fail(FILE_LINE_ARGS, float_trailing_point_plus); // float-trailing-point-plus
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, float_leading_zero);
|
parsing_should_fail(FILE_LINE_ARGS, float_trailing_point); // float-trailing-point
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, float_nan_incomplete_1);
|
parsing_should_fail(FILE_LINE_ARGS, float_trailing_us); // float-trailing-us
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, float_nan_incomplete_2);
|
parsing_should_fail(FILE_LINE_ARGS, float_us_after_point); // float-us-after-point
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, float_nan_incomplete_3);
|
parsing_should_fail(FILE_LINE_ARGS, float_us_before_point); // float-us-before-point
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, float_nan_underscore);
|
parsing_should_fail(FILE_LINE_ARGS, inline_table_double_comma); // inline-table-double-comma
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, float_trailing_point_min);
|
parsing_should_fail(FILE_LINE_ARGS, inline_table_empty); // inline-table-empty
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, float_trailing_point_plus);
|
parsing_should_fail(FILE_LINE_ARGS, inline_table_no_comma); // inline-table-no-comma
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, float_trailing_point);
|
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, float_trailing_us);
|
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, float_us_after_point);
|
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, float_us_before_point);
|
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, inline_table_double_comma);
|
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, inline_table_empty);
|
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, inline_table_no_comma);
|
|
||||||
|
|
||||||
#if !TOML_LANG_UNRELEASED
|
#if !TOML_LANG_UNRELEASED
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, inline_table_linebreak_1);
|
parsing_should_fail(FILE_LINE_ARGS, inline_table_linebreak_1); // inline-table-linebreak-1
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, inline_table_linebreak_2);
|
parsing_should_fail(FILE_LINE_ARGS, inline_table_linebreak_2); // inline-table-linebreak-2
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, inline_table_linebreak_3);
|
parsing_should_fail(FILE_LINE_ARGS, inline_table_linebreak_3); // inline-table-linebreak-3
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, inline_table_trailing_comma);
|
parsing_should_fail(FILE_LINE_ARGS, inline_table_linebreak_4); // inline-table-linebreak-4
|
||||||
|
|
||||||
|
parsing_should_fail(FILE_LINE_ARGS, inline_table_trailing_comma); // inline-table-trailing-comma
|
||||||
|
|
||||||
#endif // !TOML_LANG_UNRELEASED
|
#endif // !TOML_LANG_UNRELEASED
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, integer_capital_bin);
|
parsing_should_fail(FILE_LINE_ARGS, integer_capital_bin); // integer-capital-bin
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, integer_capital_hex);
|
parsing_should_fail(FILE_LINE_ARGS, integer_capital_hex); // integer-capital-hex
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, integer_capital_oct);
|
parsing_should_fail(FILE_LINE_ARGS, integer_capital_oct); // integer-capital-oct
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, integer_double_sign_nex);
|
parsing_should_fail(FILE_LINE_ARGS, integer_double_sign_nex); // integer-double-sign-nex
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, integer_double_sign_plus);
|
parsing_should_fail(FILE_LINE_ARGS, integer_double_sign_plus); // integer-double-sign-plus
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, integer_double_us);
|
parsing_should_fail(FILE_LINE_ARGS, integer_double_us); // integer-double-us
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, integer_invalid_bin);
|
parsing_should_fail(FILE_LINE_ARGS, integer_invalid_bin); // integer-invalid-bin
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, integer_invalid_hex);
|
parsing_should_fail(FILE_LINE_ARGS, integer_invalid_hex); // integer-invalid-hex
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, integer_invalid_oct);
|
parsing_should_fail(FILE_LINE_ARGS, integer_invalid_oct); // integer-invalid-oct
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, integer_leading_us_bin);
|
parsing_should_fail(FILE_LINE_ARGS, integer_leading_us_bin); // integer-leading-us-bin
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, integer_leading_us_hex);
|
parsing_should_fail(FILE_LINE_ARGS, integer_leading_us_hex); // integer-leading-us-hex
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, integer_leading_us_oct);
|
parsing_should_fail(FILE_LINE_ARGS, integer_leading_us_oct); // integer-leading-us-oct
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, integer_leading_us);
|
parsing_should_fail(FILE_LINE_ARGS, integer_leading_us); // integer-leading-us
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, integer_leading_zero_1);
|
parsing_should_fail(FILE_LINE_ARGS, integer_leading_zero_1); // integer-leading-zero-1
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, integer_leading_zero_2);
|
parsing_should_fail(FILE_LINE_ARGS, integer_leading_zero_2); // integer-leading-zero-2
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, integer_leading_zero_sign_1);
|
parsing_should_fail(FILE_LINE_ARGS, integer_leading_zero_sign_1); // integer-leading-zero-sign-1
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, integer_leading_zero_sign_2);
|
parsing_should_fail(FILE_LINE_ARGS, integer_leading_zero_sign_2); // integer-leading-zero-sign-2
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, integer_negative_bin);
|
parsing_should_fail(FILE_LINE_ARGS, integer_negative_bin); // integer-negative-bin
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, integer_negative_hex);
|
parsing_should_fail(FILE_LINE_ARGS, integer_negative_hex); // integer-negative-hex
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, integer_negative_oct);
|
parsing_should_fail(FILE_LINE_ARGS, integer_negative_oct); // integer-negative-oct
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, integer_positive_bin);
|
parsing_should_fail(FILE_LINE_ARGS, integer_positive_bin); // integer-positive-bin
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, integer_positive_hex);
|
parsing_should_fail(FILE_LINE_ARGS, integer_positive_hex); // integer-positive-hex
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, integer_positive_oct);
|
parsing_should_fail(FILE_LINE_ARGS, integer_positive_oct); // integer-positive-oct
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, integer_trailing_us_bin);
|
parsing_should_fail(FILE_LINE_ARGS, integer_text_after_integer); // integer-text-after-integer
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, integer_trailing_us_hex);
|
parsing_should_fail(FILE_LINE_ARGS, integer_trailing_us_bin); // integer-trailing-us-bin
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, integer_trailing_us_oct);
|
parsing_should_fail(FILE_LINE_ARGS, integer_trailing_us_hex); // integer-trailing-us-hex
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, integer_trailing_us);
|
parsing_should_fail(FILE_LINE_ARGS, integer_trailing_us_oct); // integer-trailing-us-oct
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, integer_us_after_bin);
|
parsing_should_fail(FILE_LINE_ARGS, integer_trailing_us); // integer-trailing-us
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, integer_us_after_hex);
|
parsing_should_fail(FILE_LINE_ARGS, integer_us_after_bin); // integer-us-after-bin
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, integer_us_after_oct);
|
parsing_should_fail(FILE_LINE_ARGS, integer_us_after_hex); // integer-us-after-hex
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, key_after_array);
|
parsing_should_fail(FILE_LINE_ARGS, integer_us_after_oct); // integer-us-after-oct
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, key_after_table);
|
parsing_should_fail(FILE_LINE_ARGS, key_after_array); // key-after-array
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, key_after_value);
|
parsing_should_fail(FILE_LINE_ARGS, key_after_table); // key-after-table
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, key_bare_invalid_character);
|
parsing_should_fail(FILE_LINE_ARGS, key_after_value); // key-after-value
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, key_dotted_redefine_table);
|
parsing_should_fail(FILE_LINE_ARGS, key_bare_invalid_character); // key-bare-invalid-character
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, key_duplicate);
|
parsing_should_fail(FILE_LINE_ARGS, key_dotted_redefine_table); // key-dotted-redefine-table
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, key_empty);
|
parsing_should_fail(FILE_LINE_ARGS, key_duplicate_keys); // key-duplicate-keys
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, key_escape);
|
parsing_should_fail(FILE_LINE_ARGS, key_duplicate); // key-duplicate
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, key_hash);
|
parsing_should_fail(FILE_LINE_ARGS, key_empty); // key-empty
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, key_multiline);
|
parsing_should_fail(FILE_LINE_ARGS, key_escape); // key-escape
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, key_newline);
|
parsing_should_fail(FILE_LINE_ARGS, key_hash); // key-hash
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, key_no_eol);
|
parsing_should_fail(FILE_LINE_ARGS, key_multiline); // key-multiline
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, key_open_bracket);
|
parsing_should_fail(FILE_LINE_ARGS, key_newline); // key-newline
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, key_partial_quoted);
|
parsing_should_fail(FILE_LINE_ARGS, key_no_eol); // key-no-eol
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, key_single_open_bracket);
|
parsing_should_fail(FILE_LINE_ARGS, key_open_bracket); // key-open-bracket
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, key_space);
|
parsing_should_fail(FILE_LINE_ARGS, key_partial_quoted); // key-partial-quoted
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, key_start_bracket);
|
parsing_should_fail(FILE_LINE_ARGS, key_single_open_bracket); // key-single-open-bracket
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, key_two_equals);
|
parsing_should_fail(FILE_LINE_ARGS, key_space); // key-space
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, key_two_equals2);
|
parsing_should_fail(FILE_LINE_ARGS, key_start_bracket); // key-start-bracket
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, key_two_equals3);
|
parsing_should_fail(FILE_LINE_ARGS, key_two_equals); // key-two-equals
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, key_without_value_1);
|
parsing_should_fail(FILE_LINE_ARGS, key_two_equals2); // key-two-equals2
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, key_without_value_2);
|
parsing_should_fail(FILE_LINE_ARGS, key_two_equals3); // key-two-equals3
|
||||||
|
|
||||||
|
parsing_should_fail(FILE_LINE_ARGS, key_without_value_1); // key-without-value-1
|
||||||
|
|
||||||
|
parsing_should_fail(FILE_LINE_ARGS, key_without_value_2); // key-without-value-2
|
||||||
|
|
||||||
#if !TOML_LANG_UNRELEASED && UNICODE_LITERALS_OK
|
#if !TOML_LANG_UNRELEASED && UNICODE_LITERALS_OK
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, key_special_character);
|
parsing_should_fail(FILE_LINE_ARGS, key_special_character); // key-special-character
|
||||||
|
|
||||||
#endif // !TOML_LANG_UNRELEASED && UNICODE_LITERALS_OK
|
#endif // !TOML_LANG_UNRELEASED && UNICODE_LITERALS_OK
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, llbrace);
|
parsing_should_fail(FILE_LINE_ARGS, string_bad_byte_escape); // string-bad-byte-escape
|
||||||
|
|
||||||
|
parsing_should_fail(FILE_LINE_ARGS, string_bad_codepoint); // string-bad-codepoint
|
||||||
|
|
||||||
|
parsing_should_fail(FILE_LINE_ARGS, string_bad_concat); // string-bad-concat
|
||||||
|
|
||||||
|
parsing_should_fail(FILE_LINE_ARGS, string_bad_escape); // string-bad-escape
|
||||||
|
|
||||||
|
parsing_should_fail(FILE_LINE_ARGS, string_bad_multiline); // string-bad-multiline
|
||||||
|
|
||||||
|
parsing_should_fail(FILE_LINE_ARGS, string_bad_slash_escape); // string-bad-slash-escape
|
||||||
|
|
||||||
|
parsing_should_fail(FILE_LINE_ARGS, string_bad_uni_esc); // string-bad-uni-esc
|
||||||
|
|
||||||
|
parsing_should_fail(FILE_LINE_ARGS, string_basic_multiline_out_of_range_unicode_escape_1); // string-basic-multiline-out-of-range-unicode-escape-1
|
||||||
|
|
||||||
|
parsing_should_fail(FILE_LINE_ARGS, string_basic_multiline_out_of_range_unicode_escape_2); // string-basic-multiline-out-of-range-unicode-escape-2
|
||||||
|
|
||||||
|
parsing_should_fail(FILE_LINE_ARGS, string_basic_multiline_quotes); // string-basic-multiline-quotes
|
||||||
|
|
||||||
|
parsing_should_fail(FILE_LINE_ARGS, string_basic_multiline_unknown_escape); // string-basic-multiline-unknown-escape
|
||||||
|
|
||||||
|
parsing_should_fail(FILE_LINE_ARGS, string_basic_out_of_range_unicode_escape_1); // string-basic-out-of-range-unicode-escape-1
|
||||||
|
|
||||||
|
parsing_should_fail(FILE_LINE_ARGS, string_basic_out_of_range_unicode_escape_2); // string-basic-out-of-range-unicode-escape-2
|
||||||
|
|
||||||
|
parsing_should_fail(FILE_LINE_ARGS, string_basic_unknown_escape); // string-basic-unknown-escape
|
||||||
|
|
||||||
|
parsing_should_fail(FILE_LINE_ARGS, string_literal_multiline_quotes_1); // string-literal-multiline-quotes-1
|
||||||
|
|
||||||
|
parsing_should_fail(FILE_LINE_ARGS, string_literal_multiline_quotes_2); // string-literal-multiline-quotes-2
|
||||||
|
|
||||||
|
parsing_should_fail(FILE_LINE_ARGS, string_missing_quotes); // string-missing-quotes
|
||||||
|
|
||||||
|
parsing_should_fail(FILE_LINE_ARGS, string_multiline_escape_space); // string-multiline-escape-space
|
||||||
|
|
||||||
|
parsing_should_fail(FILE_LINE_ARGS, string_multiline_no_close_2); // string-multiline-no-close-2
|
||||||
|
|
||||||
|
parsing_should_fail(FILE_LINE_ARGS, string_multiline_no_close); // string-multiline-no-close
|
||||||
|
|
||||||
|
parsing_should_fail(FILE_LINE_ARGS, string_multiline_quotes_1); // string-multiline-quotes-1
|
||||||
|
|
||||||
|
parsing_should_fail(FILE_LINE_ARGS, string_multiline_quotes_2); // string-multiline-quotes-2
|
||||||
|
|
||||||
|
parsing_should_fail(FILE_LINE_ARGS, string_no_close); // string-no-close
|
||||||
|
|
||||||
|
parsing_should_fail(FILE_LINE_ARGS, string_text_after_string); // string-text-after-string
|
||||||
|
|
||||||
|
parsing_should_fail(FILE_LINE_ARGS, string_wrong_close); // string-wrong-close
|
||||||
|
|
||||||
#if !TOML_LANG_UNRELEASED
|
#if !TOML_LANG_UNRELEASED
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, multi_line_inline_table);
|
parsing_should_fail(FILE_LINE_ARGS, string_basic_byte_escapes); // string-basic-byte-escapes
|
||||||
|
|
||||||
#endif // !TOML_LANG_UNRELEASED
|
#endif // !TOML_LANG_UNRELEASED
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, multi_line_string_no_close_2);
|
parsing_should_fail(FILE_LINE_ARGS, table_array_empty); // table-array-empty
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, multi_line_string_no_close);
|
parsing_should_fail(FILE_LINE_ARGS, table_array_implicit); // table-array-implicit
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, rrbrace);
|
parsing_should_fail(FILE_LINE_ARGS, table_array_missing_bracket); // table-array-missing-bracket
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, string_bad_byte_escape);
|
parsing_should_fail(FILE_LINE_ARGS, table_duplicate_key_table); // table-duplicate-key-table
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, string_bad_codepoint);
|
parsing_should_fail(FILE_LINE_ARGS, table_duplicate_table_array); // table-duplicate-table-array
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, string_bad_concat);
|
parsing_should_fail(FILE_LINE_ARGS, table_duplicate_table_array2); // table-duplicate-table-array2
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, string_bad_escape);
|
parsing_should_fail(FILE_LINE_ARGS, table_duplicate); // table-duplicate
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, string_bad_multiline);
|
parsing_should_fail(FILE_LINE_ARGS, table_empty_implicit_table); // table-empty-implicit-table
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, string_bad_slash_escape);
|
parsing_should_fail(FILE_LINE_ARGS, table_empty); // table-empty
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, string_bad_uni_esc);
|
parsing_should_fail(FILE_LINE_ARGS, table_equals_sign); // table-equals-sign
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, string_basic_multiline_out_of_range_unicode_escape_1);
|
parsing_should_fail(FILE_LINE_ARGS, table_llbrace); // table-llbrace
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, string_basic_multiline_out_of_range_unicode_escape_2);
|
parsing_should_fail(FILE_LINE_ARGS, table_nested_brackets_close); // table-nested-brackets-close
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, string_basic_multiline_quotes);
|
parsing_should_fail(FILE_LINE_ARGS, table_nested_brackets_open); // table-nested-brackets-open
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, string_basic_multiline_unknown_escape);
|
parsing_should_fail(FILE_LINE_ARGS, table_quoted_no_close); // table-quoted-no-close
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, string_basic_out_of_range_unicode_escape_1);
|
parsing_should_fail(FILE_LINE_ARGS, table_redefine); // table-redefine
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, string_basic_out_of_range_unicode_escape_2);
|
parsing_should_fail(FILE_LINE_ARGS, table_rrbrace); // table-rrbrace
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, string_basic_unknown_escape);
|
parsing_should_fail(FILE_LINE_ARGS, table_text_after_table); // table-text-after-table
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, string_literal_multiline_quotes_1);
|
parsing_should_fail(FILE_LINE_ARGS, table_whitespace); // table-whitespace
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, string_literal_multiline_quotes_2);
|
parsing_should_fail(FILE_LINE_ARGS, table_with_pound); // table-with-pound
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, string_missing_quotes);
|
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, string_multiline_escape_space);
|
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, string_multiline_quotes_1);
|
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, string_multiline_quotes_2);
|
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, string_no_close);
|
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, string_wrong_close);
|
|
||||||
|
|
||||||
#if !TOML_LANG_UNRELEASED
|
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, string_basic_byte_escapes);
|
|
||||||
|
|
||||||
#endif // !TOML_LANG_UNRELEASED
|
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, table_array_empty);
|
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, table_array_implicit);
|
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, table_array_missing_bracket);
|
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, table_duplicate);
|
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, table_empty);
|
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, table_equals_sign);
|
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, table_nested_brackets_close);
|
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, table_nested_brackets_open);
|
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, table_quoted_no_close);
|
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, table_redefine);
|
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, table_whitespace);
|
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, table_with_pound);
|
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, text_after_array_entries);
|
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, text_after_integer);
|
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, text_after_string);
|
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, text_after_table);
|
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, text_before_array_separator);
|
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, text_in_array);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -148,76 +148,76 @@ TOML_ENABLE_WARNINGS;
|
|||||||
|
|
||||||
TEST_CASE("conformance - iarna/invalid")
|
TEST_CASE("conformance - iarna/invalid")
|
||||||
{
|
{
|
||||||
parsing_should_fail(FILE_LINE_ARGS, array_of_tables_1);
|
parsing_should_fail(FILE_LINE_ARGS, array_of_tables_1); // array-of-tables-1
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, array_of_tables_2);
|
parsing_should_fail(FILE_LINE_ARGS, array_of_tables_2); // array-of-tables-2
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, bare_key_1);
|
parsing_should_fail(FILE_LINE_ARGS, bare_key_1); // bare-key-1
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, bare_key_2);
|
parsing_should_fail(FILE_LINE_ARGS, bare_key_2); // bare-key-2
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, bare_key_3);
|
parsing_should_fail(FILE_LINE_ARGS, bare_key_3); // bare-key-3
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, inline_table_imutable_1);
|
parsing_should_fail(FILE_LINE_ARGS, inline_table_imutable_1); // inline-table-imutable-1
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, inline_table_imutable_2);
|
parsing_should_fail(FILE_LINE_ARGS, inline_table_imutable_2); // inline-table-imutable-2
|
||||||
|
|
||||||
#if !TOML_LANG_UNRELEASED
|
#if !TOML_LANG_UNRELEASED
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, inline_table_trailing_comma);
|
parsing_should_fail(FILE_LINE_ARGS, inline_table_trailing_comma); // inline-table-trailing-comma
|
||||||
|
|
||||||
#endif // !TOML_LANG_UNRELEASED
|
#endif // !TOML_LANG_UNRELEASED
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, int_0_padded);
|
parsing_should_fail(FILE_LINE_ARGS, int_0_padded); // int-0-padded
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, int_signed_bin);
|
parsing_should_fail(FILE_LINE_ARGS, int_signed_bin); // int-signed-bin
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, int_signed_hex);
|
parsing_should_fail(FILE_LINE_ARGS, int_signed_hex); // int-signed-hex
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, int_signed_oct);
|
parsing_should_fail(FILE_LINE_ARGS, int_signed_oct); // int-signed-oct
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, key_value_pair_1);
|
parsing_should_fail(FILE_LINE_ARGS, key_value_pair_1); // key-value-pair-1
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, key_value_pair_2);
|
parsing_should_fail(FILE_LINE_ARGS, key_value_pair_2); // key-value-pair-2
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, multiple_dot_key);
|
parsing_should_fail(FILE_LINE_ARGS, multiple_dot_key); // multiple-dot-key
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, multiple_key);
|
parsing_should_fail(FILE_LINE_ARGS, multiple_key); // multiple-key
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, no_key_name);
|
parsing_should_fail(FILE_LINE_ARGS, no_key_name); // no-key-name
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, string_basic_multiline_invalid_backslash);
|
parsing_should_fail(FILE_LINE_ARGS, string_basic_multiline_invalid_backslash); // string-basic-multiline-invalid-backslash
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, string_basic_multiline_out_of_range_unicode_escape_1);
|
parsing_should_fail(FILE_LINE_ARGS, string_basic_multiline_out_of_range_unicode_escape_1); // string-basic-multiline-out-of-range-unicode-escape-1
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, string_basic_multiline_out_of_range_unicode_escape_2);
|
parsing_should_fail(FILE_LINE_ARGS, string_basic_multiline_out_of_range_unicode_escape_2); // string-basic-multiline-out-of-range-unicode-escape-2
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, string_basic_multiline_quotes);
|
parsing_should_fail(FILE_LINE_ARGS, string_basic_multiline_quotes); // string-basic-multiline-quotes
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, string_basic_multiline_unknown_escape);
|
parsing_should_fail(FILE_LINE_ARGS, string_basic_multiline_unknown_escape); // string-basic-multiline-unknown-escape
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, string_basic_out_of_range_unicode_escape_1);
|
parsing_should_fail(FILE_LINE_ARGS, string_basic_out_of_range_unicode_escape_1); // string-basic-out-of-range-unicode-escape-1
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, string_basic_out_of_range_unicode_escape_2);
|
parsing_should_fail(FILE_LINE_ARGS, string_basic_out_of_range_unicode_escape_2); // string-basic-out-of-range-unicode-escape-2
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, string_basic_unknown_escape);
|
parsing_should_fail(FILE_LINE_ARGS, string_basic_unknown_escape); // string-basic-unknown-escape
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, string_literal_multiline_quotes);
|
parsing_should_fail(FILE_LINE_ARGS, string_literal_multiline_quotes); // string-literal-multiline-quotes
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, table_1);
|
parsing_should_fail(FILE_LINE_ARGS, table_1); // table-1
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, table_2);
|
parsing_should_fail(FILE_LINE_ARGS, table_2); // table-2
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, table_3);
|
parsing_should_fail(FILE_LINE_ARGS, table_3); // table-3
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, table_4);
|
parsing_should_fail(FILE_LINE_ARGS, table_4); // table-4
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, table_invalid_1);
|
parsing_should_fail(FILE_LINE_ARGS, table_invalid_1); // table-invalid-1
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, table_invalid_2);
|
parsing_should_fail(FILE_LINE_ARGS, table_invalid_2); // table-invalid-2
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, table_invalid_3);
|
parsing_should_fail(FILE_LINE_ARGS, table_invalid_3); // table-invalid-3
|
||||||
|
|
||||||
parsing_should_fail(FILE_LINE_ARGS, table_invalid_4);
|
parsing_should_fail(FILE_LINE_ARGS, table_invalid_4); // table-invalid-4
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -270,7 +270,7 @@ TOML_ENABLE_WARNINGS;
|
|||||||
|
|
||||||
TEST_CASE("conformance - iarna/valid")
|
TEST_CASE("conformance - iarna/valid")
|
||||||
{
|
{
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_array_1, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_array_1, [](toml::table&& tbl) // spec-array-1
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{
|
{
|
||||||
@ -284,7 +284,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_array_2, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_array_2, [](toml::table&& tbl) // spec-array-2
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{
|
{
|
||||||
@ -298,7 +298,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_array_3, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_array_3, [](toml::table&& tbl) // spec-array-3
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{
|
{
|
||||||
@ -318,7 +318,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_array_4, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_array_4, [](toml::table&& tbl) // spec-array-4
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{
|
{
|
||||||
@ -333,7 +333,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_array_5, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_array_5, [](toml::table&& tbl) // spec-array-5
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{
|
{
|
||||||
@ -353,7 +353,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_array_7, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_array_7, [](toml::table&& tbl) // spec-array-7
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{
|
{
|
||||||
@ -367,7 +367,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_array_8, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_array_8, [](toml::table&& tbl) // spec-array-8
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{
|
{
|
||||||
@ -380,7 +380,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_array_mixed_number_types, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_array_mixed_number_types, [](toml::table&& tbl) // spec-array-mixed-number-types
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{
|
{
|
||||||
@ -397,7 +397,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_array_more_mixed_types, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_array_more_mixed_types, [](toml::table&& tbl) // spec-array-more-mixed-types
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{
|
{
|
||||||
@ -414,7 +414,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_array_of_tables_1, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_array_of_tables_1, [](toml::table&& tbl) // spec-array-of-tables-1
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{
|
{
|
||||||
@ -435,7 +435,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_array_of_tables_2, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_array_of_tables_2, [](toml::table&& tbl) // spec-array-of-tables-2
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{
|
{
|
||||||
@ -475,7 +475,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_array_of_tables_3, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_array_of_tables_3, [](toml::table&& tbl) // spec-array-of-tables-3
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{
|
{
|
||||||
@ -501,7 +501,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_boolean_1, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_boolean_1, [](toml::table&& tbl) // spec-boolean-1
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(bool1)"sv, true },
|
{ R"(bool1)"sv, true },
|
||||||
@ -509,7 +509,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_boolean_2, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_boolean_2, [](toml::table&& tbl) // spec-boolean-2
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(bool1)"sv, false },
|
{ R"(bool1)"sv, false },
|
||||||
@ -517,7 +517,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_case_sensitive, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_case_sensitive, [](toml::table&& tbl) // spec-case-sensitive
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(abc)"sv, 123 },
|
{ R"(abc)"sv, 123 },
|
||||||
@ -526,7 +526,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_comment_mid_array, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_comment_mid_array, [](toml::table&& tbl) // spec-comment-mid-array
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{
|
{
|
||||||
@ -539,7 +539,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_comment_mid_string, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_comment_mid_string, [](toml::table&& tbl) // spec-comment-mid-string
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(another)"sv, R"(# This is not a comment)"sv },
|
{ R"(another)"sv, R"(# This is not a comment)"sv },
|
||||||
@ -547,7 +547,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_comment_tab, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_comment_tab, [](toml::table&& tbl) // spec-comment-tab
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(key)"sv, R"(value)"sv },
|
{ R"(key)"sv, R"(value)"sv },
|
||||||
@ -555,7 +555,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_comment, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_comment, [](toml::table&& tbl) // spec-comment
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(key)"sv, R"(value)"sv },
|
{ R"(key)"sv, R"(value)"sv },
|
||||||
@ -563,7 +563,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_date_local_1, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_date_local_1, [](toml::table&& tbl) // spec-date-local-1
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(ld1)"sv, toml::date{ 1979, 5, 27 } },
|
{ R"(ld1)"sv, toml::date{ 1979, 5, 27 } },
|
||||||
@ -571,7 +571,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_date_time_1, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_date_time_1, [](toml::table&& tbl) // spec-date-time-1
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(odt1)"sv, toml::date_time{ { 1979, 5, 27 }, { 7, 32, 0, 0u }, { 0, 0 } } },
|
{ R"(odt1)"sv, toml::date_time{ { 1979, 5, 27 }, { 7, 32, 0, 0u }, { 0, 0 } } },
|
||||||
@ -579,7 +579,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_date_time_2, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_date_time_2, [](toml::table&& tbl) // spec-date-time-2
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(odt2)"sv, toml::date_time{ { 1979, 5, 27 }, { 0, 32, 0, 0u }, { -7, 0 } } },
|
{ R"(odt2)"sv, toml::date_time{ { 1979, 5, 27 }, { 0, 32, 0, 0u }, { -7, 0 } } },
|
||||||
@ -587,7 +587,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_date_time_3, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_date_time_3, [](toml::table&& tbl) // spec-date-time-3
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(odt3)"sv, toml::date_time{ { 1979, 5, 27 }, { 0, 32, 0, 999999000u }, { -7, 0 } } },
|
{ R"(odt3)"sv, toml::date_time{ { 1979, 5, 27 }, { 0, 32, 0, 999999000u }, { -7, 0 } } },
|
||||||
@ -595,7 +595,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_date_time_4, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_date_time_4, [](toml::table&& tbl) // spec-date-time-4
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(odt4)"sv, toml::date_time{ { 1979, 5, 27 }, { 7, 32, 0, 0u }, { 0, 0 } } },
|
{ R"(odt4)"sv, toml::date_time{ { 1979, 5, 27 }, { 7, 32, 0, 0u }, { 0, 0 } } },
|
||||||
@ -603,7 +603,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_date_time_5, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_date_time_5, [](toml::table&& tbl) // spec-date-time-5
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(odt5)"sv, toml::date_time{ { 1979, 5, 27 }, { 7, 32, 0, 123000000u }, { 0, 0 } } },
|
{ R"(odt5)"sv, toml::date_time{ { 1979, 5, 27 }, { 7, 32, 0, 123000000u }, { 0, 0 } } },
|
||||||
@ -611,7 +611,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_date_time_local_1, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_date_time_local_1, [](toml::table&& tbl) // spec-date-time-local-1
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(ldt1)"sv, toml::date_time{ { 1979, 5, 27 }, { 7, 32, 0, 0u } } },
|
{ R"(ldt1)"sv, toml::date_time{ { 1979, 5, 27 }, { 7, 32, 0, 0u } } },
|
||||||
@ -619,7 +619,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_dotted_keys_1, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_dotted_keys_1, [](toml::table&& tbl) // spec-dotted-keys-1
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(name)"sv, R"(Orange)"sv },
|
{ R"(name)"sv, R"(Orange)"sv },
|
||||||
@ -638,7 +638,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_dotted_keys_2, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_dotted_keys_2, [](toml::table&& tbl) // spec-dotted-keys-2
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{
|
{
|
||||||
@ -650,7 +650,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_dotted_keys_3, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_dotted_keys_3, [](toml::table&& tbl) // spec-dotted-keys-3
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{
|
{
|
||||||
@ -662,7 +662,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_empty_key_name_1, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_empty_key_name_1, [](toml::table&& tbl) // spec-empty-key-name-1
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"()"sv, R"(blank)"sv },
|
{ R"()"sv, R"(blank)"sv },
|
||||||
@ -670,7 +670,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_empty_key_name_2, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_empty_key_name_2, [](toml::table&& tbl) // spec-empty-key-name-2
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"()"sv, R"(blank)"sv },
|
{ R"()"sv, R"(blank)"sv },
|
||||||
@ -678,7 +678,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_extend_dotted_object_1, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_extend_dotted_object_1, [](toml::table&& tbl) // spec-extend-dotted-object-1
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{
|
{
|
||||||
@ -695,7 +695,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_extend_dotted_object_2, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_extend_dotted_object_2, [](toml::table&& tbl) // spec-extend-dotted-object-2
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{
|
{
|
||||||
@ -716,7 +716,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_extend_dotted_object_3, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_extend_dotted_object_3, [](toml::table&& tbl) // spec-extend-dotted-object-3
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{
|
{
|
||||||
@ -737,7 +737,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_float_1, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_float_1, [](toml::table&& tbl) // spec-float-1
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(flt1)"sv, 1.0 },
|
{ R"(flt1)"sv, 1.0 },
|
||||||
@ -745,7 +745,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_float_10, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_float_10, [](toml::table&& tbl) // spec-float-10
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(sf1)"sv, std::numeric_limits<double>::infinity() },
|
{ R"(sf1)"sv, std::numeric_limits<double>::infinity() },
|
||||||
@ -753,7 +753,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_float_11, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_float_11, [](toml::table&& tbl) // spec-float-11
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(sf2)"sv, std::numeric_limits<double>::infinity() },
|
{ R"(sf2)"sv, std::numeric_limits<double>::infinity() },
|
||||||
@ -761,7 +761,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_float_12, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_float_12, [](toml::table&& tbl) // spec-float-12
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(sf2)"sv, -std::numeric_limits<double>::infinity() },
|
{ R"(sf2)"sv, -std::numeric_limits<double>::infinity() },
|
||||||
@ -769,7 +769,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_float_13, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_float_13, [](toml::table&& tbl) // spec-float-13
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(sf4)"sv, std::numeric_limits<double>::quiet_NaN() },
|
{ R"(sf4)"sv, std::numeric_limits<double>::quiet_NaN() },
|
||||||
@ -777,7 +777,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_float_14, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_float_14, [](toml::table&& tbl) // spec-float-14
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(sf5)"sv, std::numeric_limits<double>::quiet_NaN() },
|
{ R"(sf5)"sv, std::numeric_limits<double>::quiet_NaN() },
|
||||||
@ -785,7 +785,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_float_15, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_float_15, [](toml::table&& tbl) // spec-float-15
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(sf6)"sv, std::numeric_limits<double>::quiet_NaN() },
|
{ R"(sf6)"sv, std::numeric_limits<double>::quiet_NaN() },
|
||||||
@ -793,7 +793,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_float_2, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_float_2, [](toml::table&& tbl) // spec-float-2
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(flt2)"sv, 3.1415 },
|
{ R"(flt2)"sv, 3.1415 },
|
||||||
@ -801,7 +801,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_float_3, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_float_3, [](toml::table&& tbl) // spec-float-3
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(flt3)"sv, -0.01 },
|
{ R"(flt3)"sv, -0.01 },
|
||||||
@ -809,7 +809,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_float_4, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_float_4, [](toml::table&& tbl) // spec-float-4
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(flt4)"sv, 5e+22 },
|
{ R"(flt4)"sv, 5e+22 },
|
||||||
@ -817,7 +817,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_float_5, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_float_5, [](toml::table&& tbl) // spec-float-5
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(flt5)"sv, 1000000.0 },
|
{ R"(flt5)"sv, 1000000.0 },
|
||||||
@ -825,7 +825,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_float_6, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_float_6, [](toml::table&& tbl) // spec-float-6
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(flt6)"sv, -0.02 },
|
{ R"(flt6)"sv, -0.02 },
|
||||||
@ -833,7 +833,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_float_7, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_float_7, [](toml::table&& tbl) // spec-float-7
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(flt7)"sv, 6.626e-34 },
|
{ R"(flt7)"sv, 6.626e-34 },
|
||||||
@ -841,7 +841,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_float_8, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_float_8, [](toml::table&& tbl) // spec-float-8
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(flt8)"sv, 224617.445991228 },
|
{ R"(flt8)"sv, 224617.445991228 },
|
||||||
@ -849,7 +849,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_float_9, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_float_9, [](toml::table&& tbl) // spec-float-9
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(flt9)"sv, -0.0 },
|
{ R"(flt9)"sv, -0.0 },
|
||||||
@ -857,7 +857,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_int_1, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_int_1, [](toml::table&& tbl) // spec-int-1
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(int1)"sv, 99 },
|
{ R"(int1)"sv, 99 },
|
||||||
@ -865,7 +865,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_int_2, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_int_2, [](toml::table&& tbl) // spec-int-2
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(int2)"sv, 42 },
|
{ R"(int2)"sv, 42 },
|
||||||
@ -873,7 +873,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_int_3, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_int_3, [](toml::table&& tbl) // spec-int-3
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(int3)"sv, 0 },
|
{ R"(int3)"sv, 0 },
|
||||||
@ -881,7 +881,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_int_3a, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_int_3a, [](toml::table&& tbl) // spec-int-3a
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(int3)"sv, 0 },
|
{ R"(int3)"sv, 0 },
|
||||||
@ -889,7 +889,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_int_3b, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_int_3b, [](toml::table&& tbl) // spec-int-3b
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(int3)"sv, 0 },
|
{ R"(int3)"sv, 0 },
|
||||||
@ -897,7 +897,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_int_4, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_int_4, [](toml::table&& tbl) // spec-int-4
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(int4)"sv, -17 },
|
{ R"(int4)"sv, -17 },
|
||||||
@ -905,7 +905,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_int_5, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_int_5, [](toml::table&& tbl) // spec-int-5
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(int5)"sv, 1000 },
|
{ R"(int5)"sv, 1000 },
|
||||||
@ -913,7 +913,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_int_6, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_int_6, [](toml::table&& tbl) // spec-int-6
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(int6)"sv, 5349221 },
|
{ R"(int6)"sv, 5349221 },
|
||||||
@ -921,7 +921,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_int_7, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_int_7, [](toml::table&& tbl) // spec-int-7
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(int7)"sv, 12345 },
|
{ R"(int7)"sv, 12345 },
|
||||||
@ -929,7 +929,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_int_bin1, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_int_bin1, [](toml::table&& tbl) // spec-int-bin1
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(bin1)"sv, 214 },
|
{ R"(bin1)"sv, 214 },
|
||||||
@ -937,7 +937,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_int_hex1, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_int_hex1, [](toml::table&& tbl) // spec-int-hex1
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(hex1)"sv, 3735928559 },
|
{ R"(hex1)"sv, 3735928559 },
|
||||||
@ -945,7 +945,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_int_hex2, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_int_hex2, [](toml::table&& tbl) // spec-int-hex2
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(hex2)"sv, 3735928559 },
|
{ R"(hex2)"sv, 3735928559 },
|
||||||
@ -953,7 +953,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_int_hex3, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_int_hex3, [](toml::table&& tbl) // spec-int-hex3
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(hex3)"sv, 3735928559 },
|
{ R"(hex3)"sv, 3735928559 },
|
||||||
@ -961,7 +961,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_int_max, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_int_max, [](toml::table&& tbl) // spec-int-max
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(max)"sv, INT64_MAX },
|
{ R"(max)"sv, INT64_MAX },
|
||||||
@ -969,7 +969,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_int_min, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_int_min, [](toml::table&& tbl) // spec-int-min
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(min)"sv, INT64_MIN },
|
{ R"(min)"sv, INT64_MIN },
|
||||||
@ -977,7 +977,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_int_oct1, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_int_oct1, [](toml::table&& tbl) // spec-int-oct1
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(oct1)"sv, 342391 },
|
{ R"(oct1)"sv, 342391 },
|
||||||
@ -985,7 +985,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_int_oct2, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_int_oct2, [](toml::table&& tbl) // spec-int-oct2
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(oct2)"sv, 493 },
|
{ R"(oct2)"sv, 493 },
|
||||||
@ -993,7 +993,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_key_value_pair_1, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_key_value_pair_1, [](toml::table&& tbl) // spec-key-value-pair-1
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(key)"sv, R"(value)"sv },
|
{ R"(key)"sv, R"(value)"sv },
|
||||||
@ -1001,7 +1001,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_key_value_pair_2, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_key_value_pair_2, [](toml::table&& tbl) // spec-key-value-pair-2
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(bare_key)"sv, R"(value)"sv },
|
{ R"(bare_key)"sv, R"(value)"sv },
|
||||||
@ -1009,7 +1009,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_key_value_pair_3, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_key_value_pair_3, [](toml::table&& tbl) // spec-key-value-pair-3
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(bare-key)"sv, R"(value)"sv },
|
{ R"(bare-key)"sv, R"(value)"sv },
|
||||||
@ -1017,7 +1017,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_key_value_pair_4, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_key_value_pair_4, [](toml::table&& tbl) // spec-key-value-pair-4
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(1234)"sv, R"(value)"sv },
|
{ R"(1234)"sv, R"(value)"sv },
|
||||||
@ -1025,7 +1025,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_key_value_pair_5, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_key_value_pair_5, [](toml::table&& tbl) // spec-key-value-pair-5
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(1234)"sv, R"(value)"sv },
|
{ R"(1234)"sv, R"(value)"sv },
|
||||||
@ -1033,7 +1033,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_key_value_pair_6, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_key_value_pair_6, [](toml::table&& tbl) // spec-key-value-pair-6
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(-)"sv, 1 },
|
{ R"(-)"sv, 1 },
|
||||||
@ -1041,7 +1041,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_key_value_pair_7, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_key_value_pair_7, [](toml::table&& tbl) // spec-key-value-pair-7
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(_)"sv, 1 },
|
{ R"(_)"sv, 1 },
|
||||||
@ -1049,7 +1049,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_key_value_pair_8, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_key_value_pair_8, [](toml::table&& tbl) // spec-key-value-pair-8
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(-_-_-_-_-)"sv, 1 },
|
{ R"(-_-_-_-_-)"sv, 1 },
|
||||||
@ -1057,7 +1057,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_key_value_pair_9, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_key_value_pair_9, [](toml::table&& tbl) // spec-key-value-pair-9
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{
|
{
|
||||||
@ -1069,7 +1069,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_quoted_literal_keys_1, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_quoted_literal_keys_1, [](toml::table&& tbl) // spec-quoted-literal-keys-1
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(quoted "value")"sv, R"(value)"sv },
|
{ R"(quoted "value")"sv, R"(value)"sv },
|
||||||
@ -1077,7 +1077,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_readme_example, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_readme_example, [](toml::table&& tbl) // spec-readme-example
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(title)"sv, R"(TOML Example)"sv },
|
{ R"(title)"sv, R"(TOML Example)"sv },
|
||||||
@ -1143,7 +1143,7 @@ TEST_CASE("conformance - iarna/valid")
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_string_basic_multiline_1, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_string_basic_multiline_1, [](toml::table&& tbl) // spec-string-basic-multiline-1
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(str1)"sv, R"(Roses are red
|
{ R"(str1)"sv, R"(Roses are red
|
||||||
@ -1152,7 +1152,7 @@ Violets are blue)"sv },
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_string_basic_multiline_2, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_string_basic_multiline_2, [](toml::table&& tbl) // spec-string-basic-multiline-2
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(str)"sv, R"(The quick brown fox jumps over the lazy dog.)"sv },
|
{ R"(str)"sv, R"(The quick brown fox jumps over the lazy dog.)"sv },
|
||||||
@ -1160,7 +1160,7 @@ Violets are blue)"sv },
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_string_basic_multiline_3, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_string_basic_multiline_3, [](toml::table&& tbl) // spec-string-basic-multiline-3
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(str)"sv, R"(The quick brown fox jumps over the lazy dog.)"sv },
|
{ R"(str)"sv, R"(The quick brown fox jumps over the lazy dog.)"sv },
|
||||||
@ -1168,7 +1168,7 @@ Violets are blue)"sv },
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_string_basic_multiline_5, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_string_basic_multiline_5, [](toml::table&& tbl) // spec-string-basic-multiline-5
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(ml-escaped-nl)"sv, R"( foo bar \
|
{ R"(ml-escaped-nl)"sv, R"( foo bar \
|
||||||
@ -1177,7 +1177,7 @@ Violets are blue)"sv },
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_string_basic_multiline_6, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_string_basic_multiline_6, [](toml::table&& tbl) // spec-string-basic-multiline-6
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(str4)"sv, R"(Here are two quotation marks: "". Simple enough.)"sv },
|
{ R"(str4)"sv, R"(Here are two quotation marks: "". Simple enough.)"sv },
|
||||||
@ -1185,7 +1185,7 @@ Violets are blue)"sv },
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_string_basic_multiline_7, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_string_basic_multiline_7, [](toml::table&& tbl) // spec-string-basic-multiline-7
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(str5)"sv, R"(Here are three quotation marks: """.)"sv },
|
{ R"(str5)"sv, R"(Here are three quotation marks: """.)"sv },
|
||||||
@ -1193,7 +1193,7 @@ Violets are blue)"sv },
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_string_basic_multiline_8, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_string_basic_multiline_8, [](toml::table&& tbl) // spec-string-basic-multiline-8
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(str6)"sv, R"(Here are fifteen quotation marks: """"""""""""""".)"sv },
|
{ R"(str6)"sv, R"(Here are fifteen quotation marks: """"""""""""""".)"sv },
|
||||||
@ -1201,7 +1201,7 @@ Violets are blue)"sv },
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_string_basic_multiline_9, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_string_basic_multiline_9, [](toml::table&& tbl) // spec-string-basic-multiline-9
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(str7)"sv, R"("This," she said, "is just a pointless statement.")"sv },
|
{ R"(str7)"sv, R"("This," she said, "is just a pointless statement.")"sv },
|
||||||
@ -1209,7 +1209,7 @@ Violets are blue)"sv },
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_string_basic_tab_multiline, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_string_basic_tab_multiline, [](toml::table&& tbl) // spec-string-basic-tab-multiline
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(str)"sv, R"(This is a tab)"sv },
|
{ R"(str)"sv, R"(This is a tab)"sv },
|
||||||
@ -1217,7 +1217,7 @@ Violets are blue)"sv },
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_string_basic_tab, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_string_basic_tab, [](toml::table&& tbl) // spec-string-basic-tab
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(str)"sv, R"(This is a tab)"sv },
|
{ R"(str)"sv, R"(This is a tab)"sv },
|
||||||
@ -1225,7 +1225,7 @@ Violets are blue)"sv },
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_string_literal_1, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_string_literal_1, [](toml::table&& tbl) // spec-string-literal-1
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(winpath)"sv, R"(C:\Users\nodejs\templates)"sv },
|
{ R"(winpath)"sv, R"(C:\Users\nodejs\templates)"sv },
|
||||||
@ -1233,7 +1233,7 @@ Violets are blue)"sv },
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_string_literal_2, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_string_literal_2, [](toml::table&& tbl) // spec-string-literal-2
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(winpath2)"sv, R"(\\ServerX\admin$\system32\)"sv },
|
{ R"(winpath2)"sv, R"(\\ServerX\admin$\system32\)"sv },
|
||||||
@ -1241,7 +1241,7 @@ Violets are blue)"sv },
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_string_literal_3, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_string_literal_3, [](toml::table&& tbl) // spec-string-literal-3
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(quoted)"sv, R"(Tom "Dubs" Preston-Werner)"sv },
|
{ R"(quoted)"sv, R"(Tom "Dubs" Preston-Werner)"sv },
|
||||||
@ -1249,7 +1249,7 @@ Violets are blue)"sv },
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_string_literal_4, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_string_literal_4, [](toml::table&& tbl) // spec-string-literal-4
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(regex)"sv, R"(<\i\c*\s*>)"sv },
|
{ R"(regex)"sv, R"(<\i\c*\s*>)"sv },
|
||||||
@ -1257,7 +1257,7 @@ Violets are blue)"sv },
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_string_literal_multiline_1, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_string_literal_multiline_1, [](toml::table&& tbl) // spec-string-literal-multiline-1
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(regex2)"sv, R"(I [dw]on't need \d{2} apples)"sv },
|
{ R"(regex2)"sv, R"(I [dw]on't need \d{2} apples)"sv },
|
||||||
@ -1265,7 +1265,7 @@ Violets are blue)"sv },
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_string_literal_multiline_2, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_string_literal_multiline_2, [](toml::table&& tbl) // spec-string-literal-multiline-2
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(lines)"sv, R"(The first newline is
|
{ R"(lines)"sv, R"(The first newline is
|
||||||
@ -1277,7 +1277,7 @@ trimmed in raw strings.
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_string_literal_multiline_3, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_string_literal_multiline_3, [](toml::table&& tbl) // spec-string-literal-multiline-3
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(quot15)"sv, R"(Here are fifteen quotation marks: """"""""""""""")"sv },
|
{ R"(quot15)"sv, R"(Here are fifteen quotation marks: """"""""""""""")"sv },
|
||||||
@ -1285,7 +1285,7 @@ trimmed in raw strings.
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_string_literal_multiline_4, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_string_literal_multiline_4, [](toml::table&& tbl) // spec-string-literal-multiline-4
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(str)"sv, R"('That,' she said, 'is still pointless.')"sv },
|
{ R"(str)"sv, R"('That,' she said, 'is still pointless.')"sv },
|
||||||
@ -1293,7 +1293,7 @@ trimmed in raw strings.
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_table_1, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_table_1, [](toml::table&& tbl) // spec-table-1
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{
|
{
|
||||||
@ -1312,7 +1312,7 @@ trimmed in raw strings.
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_table_2, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_table_2, [](toml::table&& tbl) // spec-table-2
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{
|
{
|
||||||
@ -1332,7 +1332,7 @@ trimmed in raw strings.
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_table_3, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_table_3, [](toml::table&& tbl) // spec-table-3
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{
|
{
|
||||||
@ -1348,7 +1348,7 @@ trimmed in raw strings.
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_table_4, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_table_4, [](toml::table&& tbl) // spec-table-4
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{
|
{
|
||||||
@ -1364,7 +1364,7 @@ trimmed in raw strings.
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_table_5, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_table_5, [](toml::table&& tbl) // spec-table-5
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{
|
{
|
||||||
@ -1380,7 +1380,7 @@ trimmed in raw strings.
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_table_7, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_table_7, [](toml::table&& tbl) // spec-table-7
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{
|
{
|
||||||
@ -1400,7 +1400,7 @@ trimmed in raw strings.
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_table_8, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_table_8, [](toml::table&& tbl) // spec-table-8
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{
|
{
|
||||||
@ -1426,7 +1426,7 @@ trimmed in raw strings.
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_table_inline_1, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_table_inline_1, [](toml::table&& tbl) // spec-table-inline-1
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{
|
{
|
||||||
@ -1439,7 +1439,7 @@ trimmed in raw strings.
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_table_inline_2, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_table_inline_2, [](toml::table&& tbl) // spec-table-inline-2
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{
|
{
|
||||||
@ -1452,7 +1452,7 @@ trimmed in raw strings.
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_table_inline_3, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_table_inline_3, [](toml::table&& tbl) // spec-table-inline-3
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{
|
{
|
||||||
@ -1468,7 +1468,7 @@ trimmed in raw strings.
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_table, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_table, [](toml::table&& tbl) // spec-table
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(table)"sv, toml::table{} },
|
{ R"(table)"sv, toml::table{} },
|
||||||
@ -1476,7 +1476,7 @@ trimmed in raw strings.
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_time_1, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_time_1, [](toml::table&& tbl) // spec-time-1
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(lt1)"sv, toml::time{ 7, 32, 0, 0 } },
|
{ R"(lt1)"sv, toml::time{ 7, 32, 0, 0 } },
|
||||||
@ -1486,7 +1486,7 @@ trimmed in raw strings.
|
|||||||
|
|
||||||
#if UNICODE_LITERALS_OK
|
#if UNICODE_LITERALS_OK
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_quoted_basic_keys_1, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_quoted_basic_keys_1, [](toml::table&& tbl) // spec-quoted-basic-keys-1
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(ʎǝʞ)"sv, R"(value)"sv },
|
{ R"(ʎǝʞ)"sv, R"(value)"sv },
|
||||||
@ -1494,7 +1494,7 @@ trimmed in raw strings.
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_string_basic, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_string_basic, [](toml::table&& tbl) // spec-string-basic
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{ R"(str)"sv, R"(I'm a string. "You can quote me". Name José
|
{ R"(str)"sv, R"(I'm a string. "You can quote me". Name José
|
||||||
@ -1503,7 +1503,7 @@ Location SF.)"sv },
|
|||||||
REQUIRE(tbl == expected);
|
REQUIRE(tbl == expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
parsing_should_succeed(FILE_LINE_ARGS, spec_table_6, [](toml::table&& tbl)
|
parsing_should_succeed(FILE_LINE_ARGS, spec_table_6, [](toml::table&& tbl) // spec-table-6
|
||||||
{
|
{
|
||||||
const auto expected = toml::table{{
|
const auto expected = toml::table{{
|
||||||
{
|
{
|
||||||
|
@ -112,20 +112,38 @@ bool parsing_should_succeed(
|
|||||||
bool parsing_should_fail(
|
bool parsing_should_fail(
|
||||||
std::string_view test_file,
|
std::string_view test_file,
|
||||||
uint32_t test_line,
|
uint32_t test_line,
|
||||||
std::string_view toml_str)
|
std::string_view toml_str,
|
||||||
|
source_index expected_failure_line,
|
||||||
|
source_index expected_failure_column)
|
||||||
{
|
{
|
||||||
INFO("["sv << test_file << ", line "sv << test_line << "] "sv << "parsing_should_fail(\""sv << toml_str << "\")"sv)
|
INFO("["sv << test_file << ", line "sv << test_line << "] "sv << "parsing_should_fail(\""sv << toml_str << "\")"sv)
|
||||||
|
|
||||||
#if TOML_EXCEPTIONS
|
#if TOML_EXCEPTIONS
|
||||||
|
|
||||||
static constexpr auto run_tests = [](auto&& fn)
|
static constexpr auto run_tests = [](source_index ex_line, source_index ex_col, auto&& fn)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
fn();
|
fn();
|
||||||
}
|
}
|
||||||
catch (const parse_error&)
|
catch (const parse_error& err)
|
||||||
{
|
{
|
||||||
|
if (ex_line != static_cast<source_index>(-1) && err.source().begin.line != ex_line)
|
||||||
|
{
|
||||||
|
FORCE_FAIL("Expected parse_error at line "sv << ex_line
|
||||||
|
<< ", actually occured at line "sv << err.source().begin.line
|
||||||
|
);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ex_col != static_cast<source_index>(-1) && err.source().begin.column != ex_col)
|
||||||
|
{
|
||||||
|
FORCE_FAIL("Expected parse_error at column "sv << ex_col
|
||||||
|
<< ", actually occured at column "sv << err.source().begin.column
|
||||||
|
);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
SUCCEED("parse_error thrown OK"sv);
|
SUCCEED("parse_error thrown OK"sv);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -144,11 +162,11 @@ bool parsing_should_fail(
|
|||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
auto result = run_tests([=]()
|
auto result = run_tests(expected_failure_line, expected_failure_column, [=]()
|
||||||
{
|
{
|
||||||
[[maybe_unused]] auto res = toml::parse(toml_str);
|
[[maybe_unused]] auto res = toml::parse(toml_str);
|
||||||
});
|
});
|
||||||
result = result && run_tests([=]()
|
result = result && run_tests(expected_failure_line, expected_failure_column, [=]()
|
||||||
{
|
{
|
||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
ss.write(toml_str.data(), static_cast<std::streamsize>(toml_str.length()));
|
ss.write(toml_str.data(), static_cast<std::streamsize>(toml_str.length()));
|
||||||
@ -158,10 +176,24 @@ bool parsing_should_fail(
|
|||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
static constexpr auto run_tests = [](auto&& fn)
|
static constexpr auto run_tests = [](source_index ex_line, source_index ex_col, auto&& fn)
|
||||||
{
|
{
|
||||||
if (parse_result result = fn(); !result)
|
if (parse_result result = fn(); !result)
|
||||||
{
|
{
|
||||||
|
if (ex_line != static_cast<source_index>(-1) && result.error().source().begin.line != ex_line)
|
||||||
|
{
|
||||||
|
FORCE_FAIL("Expected parse_error at line "sv << ex_line
|
||||||
|
<< ", actually occured at line "sv << result.error().source().begin.line
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ex_col != static_cast<source_index>(-1) && result.error().source().begin.column != ex_col)
|
||||||
|
{
|
||||||
|
FORCE_FAIL("Expected parse_error at column "sv << ex_col
|
||||||
|
<< ", actually occured at column "sv << result.error().source().begin.column
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
SUCCEED("parse_error generated OK"sv);
|
SUCCEED("parse_error generated OK"sv);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -169,8 +201,8 @@ bool parsing_should_fail(
|
|||||||
FORCE_FAIL("Expected parsing failure"sv);
|
FORCE_FAIL("Expected parsing failure"sv);
|
||||||
};
|
};
|
||||||
|
|
||||||
return run_tests([=]() { return toml::parse(toml_str); })
|
return run_tests(expected_failure_line, expected_failure_column, [=]() { return toml::parse(toml_str); })
|
||||||
&& run_tests([=]()
|
&& run_tests(expected_failure_line, expected_failure_column, [=]()
|
||||||
{
|
{
|
||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
ss.write(toml_str.data(), static_cast<std::streamsize>(toml_str.length()));
|
ss.write(toml_str.data(), static_cast<std::streamsize>(toml_str.length()));
|
||||||
|
@ -132,7 +132,9 @@ bool parsing_should_succeed(
|
|||||||
bool parsing_should_fail(
|
bool parsing_should_fail(
|
||||||
std::string_view test_file,
|
std::string_view test_file,
|
||||||
uint32_t test_line,
|
uint32_t test_line,
|
||||||
std::string_view toml_str);
|
std::string_view toml_str,
|
||||||
|
source_index expected_failure_line = static_cast<source_index>(-1),
|
||||||
|
source_index expected_failure_column = static_cast<source_index>(-1));
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
inline bool parse_expected_value(
|
inline bool parse_expected_value(
|
||||||
|
@ -176,5 +176,24 @@ b = []
|
|||||||
parsing_should_fail(FILE_LINE_ARGS, std::string_view{ s });
|
parsing_should_fail(FILE_LINE_ARGS, std::string_view{ s });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SECTION("github/issues/112") // https://github.com/marzer/tomlplusplus/issues/112
|
||||||
|
{
|
||||||
|
parsing_should_fail(FILE_LINE_ARGS, R"(
|
||||||
|
[a.b.c.d]
|
||||||
|
u = 6
|
||||||
|
[a]
|
||||||
|
b.t = 8
|
||||||
|
[a.b] # should cause redefinition error here
|
||||||
|
u = 0
|
||||||
|
)", 6);
|
||||||
|
|
||||||
|
parsing_should_fail(FILE_LINE_ARGS, R"(
|
||||||
|
[a]
|
||||||
|
b.t = 8
|
||||||
|
[a.b] # should cause redefinition error here
|
||||||
|
u = 0
|
||||||
|
)", 4);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
81
toml.hpp
81
toml.hpp
@ -8744,7 +8744,7 @@ TOML_ANON_NAMESPACE_START
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <uint64_t> struct parse_integer_traits;
|
template <uint64_t> struct parse_integer_traits;
|
||||||
template <> struct parse_integer_traits<2> final
|
template <> struct parse_integer_traits<2>
|
||||||
{
|
{
|
||||||
static constexpr auto scope_qualifier = "binary integer"sv;
|
static constexpr auto scope_qualifier = "binary integer"sv;
|
||||||
static constexpr auto is_digit = ::toml::impl::is_binary_digit;
|
static constexpr auto is_digit = ::toml::impl::is_binary_digit;
|
||||||
@ -8753,7 +8753,7 @@ TOML_ANON_NAMESPACE_START
|
|||||||
static constexpr auto prefix_codepoint = U'b';
|
static constexpr auto prefix_codepoint = U'b';
|
||||||
static constexpr auto prefix = "b"sv;
|
static constexpr auto prefix = "b"sv;
|
||||||
};
|
};
|
||||||
template <> struct parse_integer_traits<8> final
|
template <> struct parse_integer_traits<8>
|
||||||
{
|
{
|
||||||
static constexpr auto scope_qualifier = "octal integer"sv;
|
static constexpr auto scope_qualifier = "octal integer"sv;
|
||||||
static constexpr auto is_digit = ::toml::impl::is_octal_digit;
|
static constexpr auto is_digit = ::toml::impl::is_octal_digit;
|
||||||
@ -8762,14 +8762,14 @@ TOML_ANON_NAMESPACE_START
|
|||||||
static constexpr auto prefix_codepoint = U'o';
|
static constexpr auto prefix_codepoint = U'o';
|
||||||
static constexpr auto prefix = "o"sv;
|
static constexpr auto prefix = "o"sv;
|
||||||
};
|
};
|
||||||
template <> struct parse_integer_traits<10> final
|
template <> struct parse_integer_traits<10>
|
||||||
{
|
{
|
||||||
static constexpr auto scope_qualifier = "decimal integer"sv;
|
static constexpr auto scope_qualifier = "decimal integer"sv;
|
||||||
static constexpr auto is_digit = ::toml::impl::is_decimal_digit;
|
static constexpr auto is_digit = ::toml::impl::is_decimal_digit;
|
||||||
static constexpr auto is_signed = true;
|
static constexpr auto is_signed = true;
|
||||||
static constexpr auto buffer_length = 19; //strlen("9223372036854775807")
|
static constexpr auto buffer_length = 19; //strlen("9223372036854775807")
|
||||||
};
|
};
|
||||||
template <> struct parse_integer_traits<16> final
|
template <> struct parse_integer_traits<16>
|
||||||
{
|
{
|
||||||
static constexpr auto scope_qualifier = "hexadecimal integer"sv;
|
static constexpr auto scope_qualifier = "hexadecimal integer"sv;
|
||||||
static constexpr auto is_digit = ::toml::impl::is_hexadecimal_digit;
|
static constexpr auto is_digit = ::toml::impl::is_hexadecimal_digit;
|
||||||
@ -8891,7 +8891,7 @@ TOML_ANON_NAMESPACE_START
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
struct error_builder final
|
struct error_builder
|
||||||
{
|
{
|
||||||
static constexpr std::size_t buf_size = 512;
|
static constexpr std::size_t buf_size = 512;
|
||||||
char buf[buf_size];
|
char buf[buf_size];
|
||||||
@ -8935,7 +8935,7 @@ TOML_ANON_NAMESPACE_START
|
|||||||
error_builder& operator=(error_builder&&) = delete;
|
error_builder& operator=(error_builder&&) = delete;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct parse_scope final
|
struct parse_scope
|
||||||
{
|
{
|
||||||
std::string_view& storage_;
|
std::string_view& storage_;
|
||||||
std::string_view parent_;
|
std::string_view parent_;
|
||||||
@ -9023,18 +9023,19 @@ TOML_ANON_NAMESPACE_START
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct parsed_key final
|
struct parsed_key
|
||||||
{
|
{
|
||||||
|
toml::source_position position;
|
||||||
std::vector<std::string> segments;
|
std::vector<std::string> segments;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct parsed_key_value_pair final
|
struct parsed_key_value_pair
|
||||||
{
|
{
|
||||||
parsed_key key;
|
parsed_key key;
|
||||||
node_ptr value;
|
node_ptr value;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct parse_depth_counter final
|
struct parse_depth_counter
|
||||||
{
|
{
|
||||||
size_t& depth_;
|
size_t& depth_;
|
||||||
|
|
||||||
@ -9056,6 +9057,11 @@ TOML_ANON_NAMESPACE_START
|
|||||||
parse_depth_counter& operator=(parse_depth_counter&&) = delete;
|
parse_depth_counter& operator=(parse_depth_counter&&) = delete;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct parsed_string
|
||||||
|
{
|
||||||
|
std::string value;
|
||||||
|
bool was_multi_line;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
TOML_ANON_NAMESPACE_END;
|
TOML_ANON_NAMESPACE_END;
|
||||||
|
|
||||||
@ -9082,8 +9088,8 @@ TOML_IMPL_NAMESPACE_START
|
|||||||
#if TOML_EXCEPTIONS
|
#if TOML_EXCEPTIONS
|
||||||
#define is_error() false
|
#define is_error() false
|
||||||
#define return_after_error(...) TOML_UNREACHABLE
|
#define return_after_error(...) TOML_UNREACHABLE
|
||||||
#define assert_not_error() (void)0
|
#define assert_not_error() static_assert(true)
|
||||||
#define return_if_error(...) (void)0
|
#define return_if_error(...) static_assert(true)
|
||||||
#define return_if_error_or_eof(...) return_if_eof(__VA_ARGS__)
|
#define return_if_error_or_eof(...) return_if_eof(__VA_ARGS__)
|
||||||
#else
|
#else
|
||||||
#define is_error() !!err
|
#define is_error() !!err
|
||||||
@ -9093,6 +9099,25 @@ TOML_IMPL_NAMESPACE_START
|
|||||||
#define return_if_error_or_eof(...) do { if (is_eof() || is_error()) return __VA_ARGS__; } while(false)
|
#define return_if_error_or_eof(...) do { if (is_eof() || is_error()) return __VA_ARGS__; } while(false)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(TOML_BREAK_AT_PARSE_ERRORS) && TOML_BREAK_AT_PARSE_ERRORS
|
||||||
|
#if defined(__has_builtin)
|
||||||
|
#if __has_builtin(__builtin_debugtrap)
|
||||||
|
#define parse_error_break() __builtin_debugtrap()
|
||||||
|
#elif __has_builtin(__debugbreak)
|
||||||
|
#define parse_error_break() __debugbreak()
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#ifndef parse_error_break
|
||||||
|
#if TOML_MSVC || TOML_ICC
|
||||||
|
#define parse_error_break() __debugbreak()
|
||||||
|
#else
|
||||||
|
#define parse_error_break() TOML_ASSERT(false)
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
#else
|
||||||
|
#define parse_error_break() static_assert(true)
|
||||||
|
#endif
|
||||||
|
|
||||||
#define set_error_and_return(ret, ...) \
|
#define set_error_and_return(ret, ...) \
|
||||||
do { if (!is_error()) set_error(__VA_ARGS__); return_after_error(ret); } while(false)
|
do { if (!is_error()) set_error(__VA_ARGS__); return_after_error(ret); } while(false)
|
||||||
|
|
||||||
@ -9114,7 +9139,7 @@ TOML_IMPL_NAMESPACE_START
|
|||||||
|
|
||||||
TOML_ABI_NAMESPACE_BOOL(TOML_EXCEPTIONS, ex, noex);
|
TOML_ABI_NAMESPACE_BOOL(TOML_EXCEPTIONS, ex, noex);
|
||||||
|
|
||||||
class parser final
|
class parser
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
static constexpr size_t max_nested_values = TOML_MAX_NESTED_VALUES;
|
static constexpr size_t max_nested_values = TOML_MAX_NESTED_VALUES;
|
||||||
@ -9156,6 +9181,8 @@ TOML_IMPL_NAMESPACE_START
|
|||||||
error_builder builder{ current_scope };
|
error_builder builder{ current_scope };
|
||||||
(builder.append(reason), ...);
|
(builder.append(reason), ...);
|
||||||
|
|
||||||
|
parse_error_break();
|
||||||
|
|
||||||
#if TOML_EXCEPTIONS
|
#if TOML_EXCEPTIONS
|
||||||
builder.finish(pos, reader.source_path());
|
builder.finish(pos, reader.source_path());
|
||||||
#else
|
#else
|
||||||
@ -9724,12 +9751,6 @@ TOML_IMPL_NAMESPACE_START
|
|||||||
set_error_and_return_default("encountered end-of-file"sv);
|
set_error_and_return_default("encountered end-of-file"sv);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct parsed_string final
|
|
||||||
{
|
|
||||||
std::string value;
|
|
||||||
bool was_multi_line;
|
|
||||||
};
|
|
||||||
|
|
||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
TOML_NEVER_INLINE
|
TOML_NEVER_INLINE
|
||||||
parsed_string parse_string() TOML_MAY_THROW
|
parsed_string parse_string() TOML_MAY_THROW
|
||||||
@ -11118,6 +11139,7 @@ TOML_IMPL_NAMESPACE_START
|
|||||||
push_parse_scope("key"sv);
|
push_parse_scope("key"sv);
|
||||||
|
|
||||||
parsed_key key;
|
parsed_key key;
|
||||||
|
key.position = current_position();
|
||||||
recording_whitespace = false;
|
recording_whitespace = false;
|
||||||
|
|
||||||
while (!is_error())
|
while (!is_error())
|
||||||
@ -11219,7 +11241,7 @@ TOML_IMPL_NAMESPACE_START
|
|||||||
assert_or_assume(*cp == U'[');
|
assert_or_assume(*cp == U'[');
|
||||||
push_parse_scope("table header"sv);
|
push_parse_scope("table header"sv);
|
||||||
|
|
||||||
const auto header_begin_pos = cp->position;
|
const source_position header_begin_pos = cp->position;
|
||||||
source_position header_end_pos;
|
source_position header_end_pos;
|
||||||
parsed_key key;
|
parsed_key key;
|
||||||
bool is_arr = false;
|
bool is_arr = false;
|
||||||
@ -11378,7 +11400,7 @@ TOML_IMPL_NAMESPACE_START
|
|||||||
&& !implicit_tables.empty())
|
&& !implicit_tables.empty())
|
||||||
{
|
{
|
||||||
auto tbl = &matching_node->ref_cast<table>();
|
auto tbl = &matching_node->ref_cast<table>();
|
||||||
if (auto found = find(implicit_tables, tbl))
|
if (auto found = find(implicit_tables, tbl); found && (tbl->empty() || tbl->is_homogeneous<table>()))
|
||||||
{
|
{
|
||||||
implicit_tables.erase(implicit_tables.cbegin() + (found - implicit_tables.data()));
|
implicit_tables.erase(implicit_tables.cbegin() + (found - implicit_tables.data()));
|
||||||
tbl->source_.begin = header_begin_pos;
|
tbl->source_.begin = header_begin_pos;
|
||||||
@ -11389,13 +11411,19 @@ TOML_IMPL_NAMESPACE_START
|
|||||||
|
|
||||||
//if we get here it's a redefinition error.
|
//if we get here it's a redefinition error.
|
||||||
if (!is_arr && matching_node->type() == node_type::table)
|
if (!is_arr && matching_node->type() == node_type::table)
|
||||||
set_error_and_return_default("cannot redefine existing table '"sv, to_sv(recording_buffer), "'"sv);
|
{
|
||||||
|
set_error_at(header_begin_pos, "cannot redefine existing table '"sv, to_sv(recording_buffer), "'"sv);
|
||||||
|
return_after_error({});
|
||||||
|
}
|
||||||
else
|
else
|
||||||
set_error_and_return_default(
|
{
|
||||||
|
set_error_at(header_begin_pos,
|
||||||
"cannot redefine existing "sv, to_sv(matching_node->type()),
|
"cannot redefine existing "sv, to_sv(matching_node->type()),
|
||||||
" '"sv, to_sv(recording_buffer),
|
" '"sv, to_sv(recording_buffer),
|
||||||
"' as "sv, is_arr ? "array-of-tables"sv : "table"sv
|
"' as "sv, is_arr ? "array-of-tables"sv : "table"sv
|
||||||
);
|
);
|
||||||
|
return_after_error({});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -11426,9 +11454,11 @@ TOML_IMPL_NAMESPACE_START
|
|||||||
dotted_key_tables.push_back(&child->ref_cast<table>());
|
dotted_key_tables.push_back(&child->ref_cast<table>());
|
||||||
child->source_ = kvp.value.get()->source_;
|
child->source_ = kvp.value.get()->source_;
|
||||||
}
|
}
|
||||||
else if (!child->is_table()
|
else if (!child->is_table() || !(
|
||||||
|| !(find(dotted_key_tables, &child->ref_cast<table>()) || find(implicit_tables, &child->ref_cast<table>())))
|
find(dotted_key_tables, &child->ref_cast<table>())
|
||||||
set_error("cannot redefine existing "sv, to_sv(child->type()), " as dotted key-value pair"sv);
|
|| find(implicit_tables, &child->ref_cast<table>())
|
||||||
|
))
|
||||||
|
set_error_at(kvp.key.position, "cannot redefine existing "sv, to_sv(child->type()), " as dotted key-value pair"sv);
|
||||||
else
|
else
|
||||||
child->source_.end = kvp.value.get()->source_.end;
|
child->source_.end = kvp.value.get()->source_.end;
|
||||||
|
|
||||||
@ -11823,6 +11853,7 @@ TOML_IMPL_NAMESPACE_START
|
|||||||
#undef advance_and_return_if_error
|
#undef advance_and_return_if_error
|
||||||
#undef advance_and_return_if_error_or_eof
|
#undef advance_and_return_if_error_or_eof
|
||||||
#undef assert_or_assume
|
#undef assert_or_assume
|
||||||
|
#undef parse_error_break
|
||||||
}
|
}
|
||||||
TOML_IMPL_NAMESPACE_END;
|
TOML_IMPL_NAMESPACE_END;
|
||||||
|
|
||||||
|
@ -211,8 +211,8 @@ def python_to_tomlpp(node):
|
|||||||
|
|
||||||
class TomlTest:
|
class TomlTest:
|
||||||
|
|
||||||
def __init__(self, file_path, is_valid_case):
|
def __init__(self, file_path, name, is_valid_case):
|
||||||
self.__name = file_path.stem
|
self.__name = name
|
||||||
self.__identifier = sanitize(self.__name)
|
self.__identifier = sanitize(self.__name)
|
||||||
self.__group = self.__identifier.strip('_').split('_')[0]
|
self.__group = self.__identifier.strip('_').split('_')[0]
|
||||||
self.__data = utils.read_all_text_from_file(file_path, logger=True).strip()
|
self.__data = utils.read_all_text_from_file(file_path, logger=True).strip()
|
||||||
@ -273,26 +273,28 @@ class TomlTest:
|
|||||||
def load_tests(source_folder, is_valid_set, ignore_list):
|
def load_tests(source_folder, is_valid_set, ignore_list):
|
||||||
source_folder = source_folder.resolve()
|
source_folder = source_folder.resolve()
|
||||||
utils.assert_existing_directory(source_folder)
|
utils.assert_existing_directory(source_folder)
|
||||||
files = utils.get_all_files(source_folder, all="*.toml")
|
files = utils.get_all_files(source_folder, all="*.toml", recursive=True)
|
||||||
|
strip_source_folder_len = len(str(source_folder))
|
||||||
|
files = [(f, str(f)[strip_source_folder_len+1:-5].replace('\\', '-').replace('/', '-').strip()) for f in files]
|
||||||
if ignore_list:
|
if ignore_list:
|
||||||
files_ = []
|
files_ = []
|
||||||
for f in files:
|
for f,n in files:
|
||||||
ignored = False
|
ignored = False
|
||||||
for ignore in ignore_list:
|
for ignore in ignore_list:
|
||||||
if isinstance(ignore, str):
|
if isinstance(ignore, str):
|
||||||
if f.stem == ignore:
|
if n == ignore:
|
||||||
ignored = True
|
ignored = True
|
||||||
break
|
break
|
||||||
elif ignore.fullmatch(f.stem) is not None: # regex
|
elif ignore.fullmatch(n) is not None: # regex
|
||||||
ignored = True
|
ignored = True
|
||||||
break
|
break
|
||||||
if not ignored:
|
if not ignored:
|
||||||
files_.append(f)
|
files_.append((f, n))
|
||||||
files = files_
|
files = files_
|
||||||
tests = []
|
tests = []
|
||||||
for f in files:
|
for f,n in files:
|
||||||
try:
|
try:
|
||||||
tests.append(TomlTest(f, is_valid_set))
|
tests.append(TomlTest(f, n, is_valid_set))
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(rf'Error reading {f}, skipping...', file=sys.stderr)
|
print(rf'Error reading {f}, skipping...', file=sys.stderr)
|
||||||
return tests
|
return tests
|
||||||
@ -319,13 +321,15 @@ def load_valid_inputs(tests, extern_root):
|
|||||||
tests['valid']['burntsushi'] = load_tests(Path(extern_root, 'toml-test', 'tests', 'valid'), True, (
|
tests['valid']['burntsushi'] = load_tests(Path(extern_root, 'toml-test', 'tests', 'valid'), True, (
|
||||||
# newline/escape handling tests. these get broken by I/O (I test them separately)
|
# newline/escape handling tests. these get broken by I/O (I test them separately)
|
||||||
'string-escapes',
|
'string-escapes',
|
||||||
# causes MSVC to run out of heap space during compilation O_o
|
|
||||||
'inline-table-key-dotted',
|
|
||||||
# broken by the json reader
|
# broken by the json reader
|
||||||
'key-alphanum',
|
'key-alphanum',
|
||||||
# breaks clang:
|
# whitespace after trailing slash in raw strings breaks GCC
|
||||||
'multiline-string',
|
'string-multiline'
|
||||||
))
|
))
|
||||||
|
add_condition(tests['valid']['burntsushi'], '!TOML_MSVC', (
|
||||||
|
'inline-table-key-dotted', # causes MSVC to run out of heap space during compilation O_o
|
||||||
|
))
|
||||||
|
|
||||||
tests['valid']['iarna'] = load_tests(Path(extern_root, 'toml-spec-tests', 'values'), True, (
|
tests['valid']['iarna'] = load_tests(Path(extern_root, 'toml-spec-tests', 'values'), True, (
|
||||||
# these are stress-tests for 'large' datasets. I test these separately. Having them inline in C++ code is insane.
|
# these are stress-tests for 'large' datasets. I test these separately. Having them inline in C++ code is insane.
|
||||||
'qa-array-inline-1000',
|
'qa-array-inline-1000',
|
||||||
@ -345,7 +349,7 @@ def load_valid_inputs(tests, extern_root):
|
|||||||
'spec-date-time-6',
|
'spec-date-time-6',
|
||||||
'spec-date-time-local-2',
|
'spec-date-time-local-2',
|
||||||
'spec-time-2',
|
'spec-time-2',
|
||||||
# breaks gcc:
|
# whitespace after trailing slash in raw strings breaks GCC
|
||||||
'spec-string-basic-multiline-4',
|
'spec-string-basic-multiline-4',
|
||||||
))
|
))
|
||||||
|
|
||||||
@ -454,12 +458,12 @@ def write_test_file(name, all_tests):
|
|||||||
expected = test.expected()
|
expected = test.expected()
|
||||||
if isinstance(expected, bool):
|
if isinstance(expected, bool):
|
||||||
if expected:
|
if expected:
|
||||||
write(f'\tparsing_should_succeed(FILE_LINE_ARGS, {test.identifier()});')
|
write(f'\tparsing_should_succeed(FILE_LINE_ARGS, {test.identifier()}); // {test.name()}')
|
||||||
else:
|
else:
|
||||||
write(f'\tparsing_should_fail(FILE_LINE_ARGS, {test.identifier()});')
|
write(f'\tparsing_should_fail(FILE_LINE_ARGS, {test.identifier()}); // {test.name()}')
|
||||||
else:
|
else:
|
||||||
s = expected.render('\t\t')
|
s = expected.render('\t\t')
|
||||||
write(f'\tparsing_should_succeed(FILE_LINE_ARGS, {test.identifier()}, [](toml::table&& tbl)')
|
write(f'\tparsing_should_succeed(FILE_LINE_ARGS, {test.identifier()}, [](toml::table&& tbl) // {test.name()}')
|
||||||
write('\t{')
|
write('\t{')
|
||||||
write(f'\t\tconst auto expected = {s};')
|
write(f'\t\tconst auto expected = {s};')
|
||||||
write('\t\tREQUIRE(tbl == expected);')
|
write('\t\tREQUIRE(tbl == expected);')
|
||||||
|
Loading…
Reference in New Issue
Block a user