toml-c version 9807761
FAIL invalid/array/extending-table
Expected an error, but no error was reported.
input sent to parser-cmd:
a = [{ b = 1 }]
# Cannot extend tables within static arrays
# https://github.com/toml-lang/toml/issues/908
[a.c]
foo = 1
output from parser-cmd (stdout):
{
"a": [{
"b": {"type": "integer", "value": "1"},
"c": {
"foo": {"type": "integer", "value": "1"}
}
}]
}
want:
Exit code 1
FAIL invalid/control/bare-cr
Expected an error, but no error was reported.
input sent to parser-cmd:
# The following line contains a single carriage return control character
output from parser-cmd (stdout):
{}
want:
Exit code 1
FAIL invalid/control/bare-null
Expected an error, but no error was reported.
input sent to parser-cmd:
bare-null = "some value"
output from parser-cmd (stdout):
{
"bare-null": {"type": "string", "value": "some value"}
}
want:
Exit code 1
FAIL invalid/control/comment-null
Expected an error, but no error was reported.
input sent to parser-cmd:
comment-null = "null" #
output from parser-cmd (stdout):
{
"comment-null": {"type": "string", "value": "null"}
}
want:
Exit code 1
FAIL invalid/control/multi-cr
Expected an error, but no error was reported.
input sent to parser-cmd:
multi-cr = """null
"""
output from parser-cmd (stdout):
{
"multi-cr": {"type": "string", "value": "null\r"}
}
want:
Exit code 1
FAIL invalid/control/rawmulti-cr
Expected an error, but no error was reported.
input sent to parser-cmd:
rawmulti-cr = '''null
'''
output from parser-cmd (stdout):
{
"rawmulti-cr": {"type": "string", "value": "null\r"}
}
want:
Exit code 1
FAIL invalid/encoding/bad-codepoint
Expected an error, but no error was reported.
input sent to parser-cmd:
# Invalid codepoint U+D800 : í €
output from parser-cmd (stdout):
{}
want:
Exit code 1
FAIL invalid/encoding/bad-utf8-in-comment
Expected an error, but no error was reported.
input sent to parser-cmd:
# Ã
output from parser-cmd (stdout):
{}
want:
Exit code 1
FAIL invalid/encoding/utf16-comment
Expected an error, but no error was reported.
input sent to parser-cmd:
# U T F - 1 6 w i t h o u t B O M
output from parser-cmd (stdout):
{}
want:
Exit code 1
FAIL invalid/encoding/utf16-key
Expected an error, but no error was reported.
input sent to parser-cmd:
k = " v "
output from parser-cmd (stdout):
{}
want:
Exit code 1
FAIL invalid/inline-table/overwrite-02
Expected an error, but no error was reported.
input sent to parser-cmd:
a={}
# Inline tables are immutable and can't be extended
[a.b]
output from parser-cmd (stdout):
{
"a": {
"b": {}
}
}
want:
Exit code 1
FAIL invalid/inline-table/trailing-comma
Expected an error, but no error was reported.
input sent to parser-cmd:
# A terminating comma (also called trailing comma) is not permitted after the
# last key/value pair in an inline table
abc = { abc = 123, }
output from parser-cmd (stdout):
{
"abc": {
"abc": {"type": "integer", "value": "123"}
}
}
want:
Exit code 1
FAIL invalid/table/append-with-dotted-keys-1
Expected an error, but no error was reported.
input sent to parser-cmd:
# First a.b.c defines a table: a.b.c = {z=9}
#
# Then we define a.b.c.t = "str" to add a str to the above table, making it:
#
# a.b.c = {z=9, t="..."}
#
# While this makes sense, logically, it was decided this is not valid TOML as
# it's too confusing/convoluted.
#
# See: https://github.com/toml-lang/toml/issues/846
# https://github.com/toml-lang/toml/pull/859
[a.b.c]
z = 9
[a]
b.c.t = "Using dotted keys to add to [a.b.c] after explicitly defining it above is not allowed"
output from parser-cmd (stdout):
{
"a": {
"b": {
"c": {
"z": {"type": "integer", "value": "9"},
"t": {
"type": "string",
"value": "Using dotted keys to add to [a.b.c] after explicitly defining it above is not allowed"
}
}
}
}
}
want:
Exit code 1
FAIL invalid/table/append-with-dotted-keys-2
Expected an error, but no error was reported.
input sent to parser-cmd:
# This is the same issue as in injection-1.toml, except that nests one level
# deeper. See that file for a more complete description.
[a.b.c.d]
z = 9
[a]
b.c.d.k.t = "Using dotted keys to add to [a.b.c.d] after explicitly defining it above is not allowed"
output from parser-cmd (stdout):
{
"a": {
"b": {
"c": {
"d": {
"z": {"type": "integer", "value": "9"},
"k": {
"t": {
"type": "string",
"value": "Using dotted keys to add to [a.b.c.d] after explicitly defining it above is not allowed"
}
}
}
}
}
}
}
want:
Exit code 1
toml-test v2025-04-19 [./toml2json]: using embedded tests
valid tests: 194 passed, 0 failed
invalid tests: 363 passed, 14 failed
==> ENCODER TESTS
(not supported)
took 0.2 2.33