deno-toml version 390845e7
FAIL valid/array/open-parent-table
error: Uncaught (in promise) SyntaxError: Parse error on line 5, column 0: Cannot parse the TOML: key length is not a positive number
throw new SyntaxError(createParseErrorMessage(scanner, error.message));
^
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/_parser.ts:753:15
at parse (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/parse.ts:26:24)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/deno-toml-decoder.ts:38:9
at eventLoopTick (ext:core/01_core.js:178:7)
Exit 1
input sent to parser-cmd:
[[parent-table.arr]]
[[parent-table.arr]]
[parent-table]
not-arr = 1
output from parser-cmd (stderr):
error: Uncaught (in promise) SyntaxError: Parse error on line 5, column 0: Cannot parse the TOML: key length is not a positive number
throw new SyntaxError(createParseErrorMessage(scanner, error.message));
^
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/_parser.ts:753:15
at parse (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/parse.ts:26:24)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/deno-toml-decoder.ts:38:9
at eventLoopTick (ext:core/01_core.js:178:7)
Exit 1
want:
FAIL valid/comment/everywhere
Key "group.d" is not "date-local" but "datetime":
Expected: map[string]any{"type":"date-local", "value":"1979-05-27"}
Your encoder: map[string]any{"type":"datetime", "value":"1979-05-27T00:00:00.000Z"}
input sent to parser-cmd:
# Top comment.
# Top comment.
# Top comment.
# [no-extraneous-groups-please]
[group] # Comment
answer = 42 # Comment
# no-extraneous-keys-please = 999
# Inbetween comment.
more = [ # Comment
# What about multiple # comments?
# Can you handle it?
#
# Evil.
# Evil.
42, 42, # Comments within arrays are fun.
# What about multiple # comments?
# Can you handle it?
#
# Evil.
# Evil.
# ] Did I fool you?
] # Hopefully not.
# Make sure the space between the datetime and "#" isn't lexed.
dt = 1979-05-27T07:32:12-07:00 # c
d = 1979-05-27 # Comment
output from parser-cmd (stdout):
{
"group": {
"answer": {"type": "float", "value": "42"},
"d": {"type": "datetime", "value": "1979-05-27T00:00:00.000Z"},
"dt": {"type": "datetime", "value": "1979-05-27T14:32:12.000Z"},
"more": [
{"type": "float", "value": "42"},
{"type": "float", "value": "42"}
]
}
}
want:
{
"group": {
"answer": {"type": "integer", "value": "42"},
"d": {"type": "date-local", "value": "1979-05-27"},
"dt": {"type": "datetime", "value": "1979-05-27T07:32:12-07:00"},
"more": [
{"type": "integer", "value": "42"},
{"type": "integer", "value": "42"}
]
}
}
FAIL valid/comment/tricky
error: Uncaught (in promise) SyntaxError: Parse error on line 23, column 0: Array is not closed
throw new SyntaxError(createParseErrorMessage(scanner, error.message));
^
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/_parser.ts:753:15
at parse (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/parse.ts:26:24)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/deno-toml-decoder.ts:38:9
at eventLoopTick (ext:core/01_core.js:178:7)
Exit 1
input sent to parser-cmd:
[section]#attached comment
#[notsection]
one = "11"#cmt
two = "22#"
three = '#'
four = """# no comment
# nor this
#also not comment"""#is_comment
five = 5.5#66
six = 6#7
8 = "eight"
#nine = 99
ten = 10e2#1
eleven = 1.11e1#23
["hash#tag"]
"#!" = "hash bang"
arr3 = [ "#", '#', """###""" ]
arr4 = [ 1,# 9, 9,
2#,9
,#9
3#]
,4]
arr5 = [[[[#["#"],
["#"]]]]#]
]
tbl1 = { "#" = '}#'}#}}
output from parser-cmd (stderr):
error: Uncaught (in promise) SyntaxError: Parse error on line 23, column 0: Array is not closed
throw new SyntaxError(createParseErrorMessage(scanner, error.message));
^
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/_parser.ts:753:15
at parse (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/parse.ts:26:24)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/deno-toml-decoder.ts:38:9
at eventLoopTick (ext:core/01_core.js:178:7)
Exit 1
want:
FAIL valid/datetime/datetime
error: Uncaught (in promise) SyntaxError: Parse error on line 4, column 21: key/value pair doesn't have "="
throw new SyntaxError(createParseErrorMessage(scanner, error.message));
^
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/_parser.ts:753:15
at parse (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/parse.ts:26:24)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/deno-toml-decoder.ts:38:9
at eventLoopTick (ext:core/01_core.js:178:7)
Exit 1
input sent to parser-cmd:
space = 1987-07-05 17:45:00Z
# ABNF is case-insensitive, both "Z" and "z" must be supported.
lower = 1987-07-05t17:45:00z
output from parser-cmd (stderr):
error: Uncaught (in promise) SyntaxError: Parse error on line 4, column 21: key/value pair doesn't have "="
throw new SyntaxError(createParseErrorMessage(scanner, error.message));
^
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/_parser.ts:753:15
at parse (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/parse.ts:26:24)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/deno-toml-decoder.ts:38:9
at eventLoopTick (ext:core/01_core.js:178:7)
Exit 1
want:
FAIL valid/datetime/edge
Key "first-date" is not "date-local" but "datetime":
Expected: map[string]any{"type":"date-local", "value":"0001-01-01"}
Your encoder: map[string]any{"type":"datetime", "value":"0001-01-01T00:00:00.000Z"}
input sent to parser-cmd:
first-offset = 0001-01-01 00:00:00Z
first-local = 0001-01-01 00:00:00
first-date = 0001-01-01
last-offset = 9999-12-31 23:59:59Z
last-local = 9999-12-31 23:59:59
last-date = 9999-12-31
output from parser-cmd (stdout):
{
"first-date": {"type": "datetime", "value": "0001-01-01T00:00:00.000Z"},
"first-local": {"type": "datetime", "value": "2001-01-01T00:00:00.000Z"},
"first-offset": {"type": "datetime", "value": "2001-01-01T00:00:00.000Z"},
"last-date": {"type": "datetime", "value": "9999-12-31T00:00:00.000Z"},
"last-local": {"type": "datetime", "value": "9999-12-31T23:59:59.000Z"},
"last-offset": {"type": "datetime", "value": "9999-12-31T23:59:59.000Z"}
}
want:
{
"first-date": {"type": "date-local", "value": "0001-01-01"},
"first-local": {"type": "datetime-local", "value": "0001-01-01T00:00:00"},
"first-offset": {"type": "datetime", "value": "0001-01-01T00:00:00Z"},
"last-date": {"type": "date-local", "value": "9999-12-31"},
"last-local": {"type": "datetime-local", "value": "9999-12-31T23:59:59"},
"last-offset": {"type": "datetime", "value": "9999-12-31T23:59:59Z"}
}
FAIL valid/datetime/leap-year
Key "2000-date" is not "date-local" but "datetime":
Expected: map[string]any{"type":"date-local", "value":"2000-02-29"}
Your encoder: map[string]any{"type":"datetime", "value":"2000-02-29T00:00:00.000Z"}
input sent to parser-cmd:
2000-datetime = 2000-02-29 15:15:15Z
2000-datetime-local = 2000-02-29 15:15:15
2000-date = 2000-02-29
2024-datetime = 2024-02-29 15:15:15Z
2024-datetime-local = 2024-02-29 15:15:15
2024-date = 2024-02-29
output from parser-cmd (stdout):
{
"2000-date": {"type": "datetime", "value": "2000-02-29T00:00:00.000Z"},
"2000-datetime": {"type": "datetime", "value": "2000-02-29T15:15:15.000Z"},
"2000-datetime-local": {"type": "datetime", "value": "2000-02-29T15:15:15.000Z"},
"2024-date": {"type": "datetime", "value": "2024-02-29T00:00:00.000Z"},
"2024-datetime": {"type": "datetime", "value": "2024-02-29T15:15:15.000Z"},
"2024-datetime-local": {"type": "datetime", "value": "2024-02-29T15:15:15.000Z"}
}
want:
{
"2000-date": {"type": "date-local", "value": "2000-02-29"},
"2000-datetime": {"type": "datetime", "value": "2000-02-29T15:15:15Z"},
"2000-datetime-local": {"type": "datetime-local", "value": "2000-02-29T15:15:15"},
"2024-date": {"type": "date-local", "value": "2024-02-29"},
"2024-datetime": {"type": "datetime", "value": "2024-02-29T15:15:15Z"},
"2024-datetime-local": {"type": "datetime-local", "value": "2024-02-29T15:15:15"}
}
FAIL valid/datetime/local
Key "local" is not "datetime-local" but "datetime":
Expected: map[string]any{"type":"datetime-local", "value":"1987-07-05T17:45:00"}
Your encoder: map[string]any{"type":"datetime", "value":"1987-07-05T16:45:00.000Z"}
input sent to parser-cmd:
local = 1987-07-05T17:45:00
milli = 1977-12-21T10:32:00.555
space = 1987-07-05 17:45:00
output from parser-cmd (stdout):
{
"local": {"type": "datetime", "value": "1987-07-05T16:45:00.000Z"},
"milli": {"type": "datetime", "value": "1977-12-21T10:32:00.555Z"},
"space": {"type": "datetime", "value": "1987-07-05T16:45:00.000Z"}
}
want:
{
"local": {"type": "datetime-local", "value": "1987-07-05T17:45:00"},
"milli": {"type": "datetime-local", "value": "1977-12-21T10:32:00.555"},
"space": {"type": "datetime-local", "value": "1987-07-05T17:45:00"}
}
FAIL valid/datetime/local-date
Key "bestdayever" is not "date-local" but "datetime":
Expected: map[string]any{"type":"date-local", "value":"1987-07-05"}
Your encoder: map[string]any{"type":"datetime", "value":"1987-07-05T00:00:00.000Z"}
input sent to parser-cmd:
bestdayever = 1987-07-05
output from parser-cmd (stdout):
{
"bestdayever": {"type": "datetime", "value": "1987-07-05T00:00:00.000Z"}
}
want:
{
"bestdayever": {"type": "date-local", "value": "1987-07-05"}
}
FAIL valid/datetime/local-time
Key "besttimeever" is not "time-local" but "string":
Expected: map[string]any{"type":"time-local", "value":"17:45:00"}
Your encoder: map[string]any{"type":"string", "value":"17:45:00"}
input sent to parser-cmd:
besttimeever = 17:45:00
milliseconds = 10:32:00.555
output from parser-cmd (stdout):
{
"besttimeever": {"type": "string", "value": "17:45:00"},
"milliseconds": {"type": "string", "value": "10:32:00.555"}
}
want:
{
"besttimeever": {"type": "time-local", "value": "17:45:00"},
"milliseconds": {"type": "time-local", "value": "10:32:00.555"}
}
FAIL valid/implicit-and-explicit-after
error: Uncaught (in promise) SyntaxError: Parse error on line 6, column 0: Cannot parse the TOML: key length is not a positive number
throw new SyntaxError(createParseErrorMessage(scanner, error.message));
^
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/_parser.ts:753:15
at parse (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/parse.ts:26:24)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/deno-toml-decoder.ts:38:9
at eventLoopTick (ext:core/01_core.js:178:7)
Exit 1
input sent to parser-cmd:
[a.b.c]
answer = 42
[a]
better = 43
output from parser-cmd (stderr):
error: Uncaught (in promise) SyntaxError: Parse error on line 6, column 0: Cannot parse the TOML: key length is not a positive number
throw new SyntaxError(createParseErrorMessage(scanner, error.message));
^
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/_parser.ts:753:15
at parse (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/parse.ts:26:24)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/deno-toml-decoder.ts:38:9
at eventLoopTick (ext:core/01_core.js:178:7)
Exit 1
want:
FAIL valid/inline-table/array-values
error: Uncaught (in promise) SyntaxError: Parse error on line 7, column 0: Array is not closed
throw new SyntaxError(createParseErrorMessage(scanner, error.message));
^
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/_parser.ts:753:15
at parse (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/parse.ts:26:24)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/deno-toml-decoder.ts:38:9
at eventLoopTick (ext:core/01_core.js:178:7)
Exit 1
input sent to parser-cmd:
# "No newlines are allowed between the curly braces unless they are valid within
# a value"
a = { a = [
]}
b = { a = [
1,
2,
], b = [
3,
4,
]}
output from parser-cmd (stderr):
error: Uncaught (in promise) SyntaxError: Parse error on line 7, column 0: Array is not closed
throw new SyntaxError(createParseErrorMessage(scanner, error.message));
^
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/_parser.ts:753:15
at parse (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/parse.ts:26:24)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/deno-toml-decoder.ts:38:9
at eventLoopTick (ext:core/01_core.js:178:7)
Exit 1
want:
FAIL valid/inline-table/empty
error: Uncaught (in promise) SyntaxError: Parse error on line 2, column 11: Invalid token after "{"
throw new SyntaxError(createParseErrorMessage(scanner, error.message));
^
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/_parser.ts:753:15
at parse (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/parse.ts:26:24)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/deno-toml-decoder.ts:38:9
at eventLoopTick (ext:core/01_core.js:178:7)
Exit 1
input sent to parser-cmd:
empty1 = {}
empty2 = { }
empty_in_array = [ { not_empty = 1 }, {} ]
empty_in_array2 = [{},{not_empty=1}]
many_empty = [{},{},{}]
nested_empty = {"empty"={}}
with_cmt ={ }#nothing here
output from parser-cmd (stderr):
error: Uncaught (in promise) SyntaxError: Parse error on line 2, column 11: Invalid token after "{"
throw new SyntaxError(createParseErrorMessage(scanner, error.message));
^
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/_parser.ts:753:15
at parse (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/parse.ts:26:24)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/deno-toml-decoder.ts:38:9
at eventLoopTick (ext:core/01_core.js:178:7)
Exit 1
want:
FAIL valid/key/quoted-unicode
Could not find key "\b \f A \x7f \u0080 ÿ \ud7ff \ue000 \uffff ð€€ \U0010ffff" in parser output.
input sent to parser-cmd:
"\u0000" = "null"
'\u0000' = "different key"
"\u0008 \u000c \U00000041 \u007f \u0080 \u00ff \ud7ff \ue000 \uffff \U00010000 \U0010ffff" = "escaped key"
"~ € ÿ ퟿  ï¿¿ ð€€ ô¿¿" = "basic key"
'l ~ € ÿ ퟿  ï¿¿ ð€€ ô¿¿' = "literal key"
output from parser-cmd (stdout):
{
"\u0000": {"type": "string", "value": "null"},
"\b \f \u000041 € ÿ ퟿  ￿ Ā00 ჿff": {"type": "string", "value": "escaped key"},
"\\u0000": {"type": "string", "value": "different key"},
"l ~ € ÿ ퟿  ï¿¿ ð€€ ô¿¿": {"type": "string", "value": "literal key"},
"~ € ÿ ퟿  ï¿¿ ð€€ ô¿¿": {"type": "string", "value": "basic key"}
}
want:
{
"\u0000": {"type": "string", "value": "null"},
"\b \f A € ÿ ퟿  ï¿¿ ð€€ ô¿¿": {"type": "string", "value": "escaped key"},
"\\u0000": {"type": "string", "value": "different key"},
"l ~ € ÿ ퟿  ï¿¿ ð€€ ô¿¿": {"type": "string", "value": "literal key"},
"~ € ÿ ퟿  ï¿¿ ð€€ ô¿¿": {"type": "string", "value": "basic key"}
}
FAIL valid/spec/local-date-0
Key "ld1" is not "date-local" but "datetime":
Expected: map[string]any{"type":"date-local", "value":"1979-05-27"}
Your encoder: map[string]any{"type":"datetime", "value":"1979-05-27T00:00:00.000Z"}
input sent to parser-cmd:
ld1 = 1979-05-27
output from parser-cmd (stdout):
{
"ld1": {"type": "datetime", "value": "1979-05-27T00:00:00.000Z"}
}
want:
{
"ld1": {"type": "date-local", "value": "1979-05-27"}
}
FAIL valid/spec/local-date-time-0
Key "ldt1" is not "datetime-local" but "datetime":
Expected: map[string]any{"type":"datetime-local", "value":"1979-05-27T07:32:00"}
Your encoder: map[string]any{"type":"datetime", "value":"1979-05-27T06:32:00.000Z"}
input sent to parser-cmd:
ldt1 = 1979-05-27T07:32:00
ldt2 = 1979-05-27T00:32:00.999
output from parser-cmd (stdout):
{
"ldt1": {"type": "datetime", "value": "1979-05-27T06:32:00.000Z"},
"ldt2": {"type": "datetime", "value": "1979-05-26T23:32:00.999Z"}
}
want:
{
"ldt1": {"type": "datetime-local", "value": "1979-05-27T07:32:00"},
"ldt2": {"type": "datetime-local", "value": "1979-05-27T00:32:00.999"}
}
FAIL valid/spec/local-time-0
Key "lt1" is not "time-local" but "string":
Expected: map[string]any{"type":"time-local", "value":"07:32:00"}
Your encoder: map[string]any{"type":"string", "value":"07:32:00"}
input sent to parser-cmd:
lt1 = 07:32:00
lt2 = 00:32:00.999
output from parser-cmd (stdout):
{
"lt1": {"type": "string", "value": "07:32:00"},
"lt2": {"type": "string", "value": "00:32:00.999"}
}
want:
{
"lt1": {"type": "time-local", "value": "07:32:00"},
"lt2": {"type": "time-local", "value": "00:32:00.999"}
}
FAIL valid/spec/table-4
error: Uncaught (in promise) SyntaxError: Parse error on line 7, column 0: Cannot parse the TOML: key length is not a positive number
throw new SyntaxError(createParseErrorMessage(scanner, error.message));
^
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/_parser.ts:753:15
at parse (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/parse.ts:26:24)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/deno-toml-decoder.ts:38:9
at eventLoopTick (ext:core/01_core.js:178:7)
Exit 1
input sent to parser-cmd:
# [x] you
# [x.y] don't
# [x.y.z] need these
[x.y.z.w] # for this to work
[x] # defining a super-table afterward is ok
output from parser-cmd (stderr):
error: Uncaught (in promise) SyntaxError: Parse error on line 7, column 0: Cannot parse the TOML: key length is not a positive number
throw new SyntaxError(createParseErrorMessage(scanner, error.message));
^
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/_parser.ts:753:15
at parse (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/parse.ts:26:24)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/deno-toml-decoder.ts:38:9
at eventLoopTick (ext:core/01_core.js:178:7)
Exit 1
want:
FAIL valid/spec/table-7
Key "owner.member_since" is not "date-local" but "datetime":
Expected: map[string]any{"type":"date-local", "value":"1999-08-04"}
Your encoder: map[string]any{"type":"datetime", "value":"1999-08-04T00:00:00.000Z"}
input sent to parser-cmd:
# Top-level table begins.
name = "Fido"
breed = "pug"
# Top-level table ends.
[owner]
name = "Regina Dogman"
member_since = 1999-08-04
output from parser-cmd (stdout):
{
"breed": {"type": "string", "value": "pug"},
"name": {"type": "string", "value": "Fido"},
"owner": {
"member_since": {"type": "datetime", "value": "1999-08-04T00:00:00.000Z"},
"name": {"type": "string", "value": "Regina Dogman"}
}
}
want:
{
"breed": {"type": "string", "value": "pug"},
"name": {"type": "string", "value": "Fido"},
"owner": {
"member_since": {"type": "date-local", "value": "1999-08-04"},
"name": {"type": "string", "value": "Regina Dogman"}
}
}
FAIL valid/string/ends-in-whitespace-escape
error: Uncaught (in promise) SyntaxError: Parse error on line 3, column 6: Invalid escape sequence: \
throw new SyntaxError(createParseErrorMessage(scanner, error.message));
^
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/_parser.ts:753:15
at parse (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/parse.ts:26:24)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/deno-toml-decoder.ts:38:9
at eventLoopTick (ext:core/01_core.js:178:7)
Exit 1
input sent to parser-cmd:
beee = """
heeee
geeee\
"""
output from parser-cmd (stderr):
error: Uncaught (in promise) SyntaxError: Parse error on line 3, column 6: Invalid escape sequence: \
throw new SyntaxError(createParseErrorMessage(scanner, error.message));
^
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/_parser.ts:753:15
at parse (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/parse.ts:26:24)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/deno-toml-decoder.ts:38:9
at eventLoopTick (ext:core/01_core.js:178:7)
Exit 1
want:
FAIL valid/string/multiline
error: Uncaught (in promise) SyntaxError: Parse error on line 19, column 23: Invalid escape sequence: \
throw new SyntaxError(createParseErrorMessage(scanner, error.message));
^
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/_parser.ts:753:15
at parse (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/parse.ts:26:24)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/deno-toml-decoder.ts:38:9
at eventLoopTick (ext:core/01_core.js:178:7)
Exit 1
input sent to parser-cmd:
# NOTE: this file includes some literal tab characters.
equivalent_one = "The quick brown fox jumps over the lazy dog."
equivalent_two = """
The quick brown \
fox jumps over \
the lazy dog."""
equivalent_three = """\
The quick brown \
fox jumps over \
the lazy dog.\
"""
whitespace-after-bs = """\
The quick brown \
fox jumps over \
the lazy dog.\
"""
no-space = """a\
b"""
# Has tab character.
keep-ws-before = """a \
b"""
escape-bs-1 = """a \\
b"""
escape-bs-2 = """a \\\
b"""
escape-bs-3 = """a \\\\
b"""
output from parser-cmd (stderr):
error: Uncaught (in promise) SyntaxError: Parse error on line 19, column 23: Invalid escape sequence: \
throw new SyntaxError(createParseErrorMessage(scanner, error.message));
^
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/_parser.ts:753:15
at parse (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/parse.ts:26:24)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/deno-toml-decoder.ts:38:9
at eventLoopTick (ext:core/01_core.js:178:7)
Exit 1
want:
FAIL valid/string/multiline-empty
error: Uncaught (in promise) SyntaxError: Parse error on line 13, column 4: Invalid escape sequence: \
throw new SyntaxError(createParseErrorMessage(scanner, error.message));
^
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/_parser.ts:753:15
at parse (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/parse.ts:26:24)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/deno-toml-decoder.ts:38:9
at eventLoopTick (ext:core/01_core.js:178:7)
Exit 1
input sent to parser-cmd:
empty-1 = """"""
# A newline immediately following the opening delimiter will be trimmed.
empty-2 = """
"""
# \ at the end of line trims newlines as well; note that last \ is followed by
# two spaces, which are ignored.
empty-3 = """\
"""
empty-4 = """\
\
\
"""
output from parser-cmd (stderr):
error: Uncaught (in promise) SyntaxError: Parse error on line 13, column 4: Invalid escape sequence: \
throw new SyntaxError(createParseErrorMessage(scanner, error.message));
^
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/_parser.ts:753:15
at parse (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/parse.ts:26:24)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/deno-toml-decoder.ts:38:9
at eventLoopTick (ext:core/01_core.js:178:7)
Exit 1
want:
FAIL valid/string/multiline-quotes
error: Uncaught (in promise) SyntaxError: Parse error on line 5, column 30: Single-line string cannot contain EOL
throw new SyntaxError(createParseErrorMessage(scanner, error.message));
^
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/_parser.ts:753:15
at parse (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/parse.ts:26:24)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/deno-toml-decoder.ts:38:9
Exit 1
input sent to parser-cmd:
# Make sure that quotes inside multiline strings are allowed, including right
# after the opening '''/""" and before the closing '''/"""
lit_one = ''''one quote''''
lit_two = '''''two quotes'''''
lit_one_space = ''' 'one quote' '''
lit_two_space = ''' ''two quotes'' '''
one = """"one quote""""
two = """""two quotes"""""
one_space = """ "one quote" """
two_space = """ ""two quotes"" """
mismatch1 = """aaa'''bbb"""
mismatch2 = '''aaa"""bbb'''
# Three opening """, then one escaped ", then two "" (allowed), and then three
# closing """
escaped = """lol\""""""
five-quotes = """
Closing with five quotes
"""""
four-quotes = """
Closing with four quotes
""""
output from parser-cmd (stderr):
error: Uncaught (in promise) SyntaxError: Parse error on line 5, column 30: Single-line string cannot contain EOL
throw new SyntaxError(createParseErrorMessage(scanner, error.message));
^
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/_parser.ts:753:15
at parse (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/parse.ts:26:24)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/deno-toml-decoder.ts:38:9
Exit 1
want:
FAIL valid/string/quoted-unicode
Values for key "escaped_string" don't match:
Expected: A € ÿ ퟿  ï¿¿ ð€€ ô¿¿
Your encoder: 41 € ÿ ퟿  ￿ Ā00 ჿff
input sent to parser-cmd:
escaped_string = "\u0000 \u0008 \u000c \U00000041 \u007f \u0080 \u00ff \ud7ff \ue000 \uffff \U00010000 \U0010ffff"
not_escaped_string = '\u0000 \u0008 \u000c \U00000041 \u007f \u0080 \u00ff \ud7ff \ue000 \uffff \U00010000 \U0010ffff'
basic_string = "~ € ÿ ퟿  ï¿¿ ð€€ ô¿¿"
literal_string = '~ € ÿ ퟿  ï¿¿ ð€€ ô¿¿'
output from parser-cmd (stdout):
{
"basic_string": {"type": "string", "value": "~ € ÿ ퟿  ï¿¿ ð€€ ô¿¿"},
"escaped_string": {"type": "string", "value": "\u0000 \b \f \u000041 € ÿ ퟿  ￿ Ā00 ჿff"},
"literal_string": {"type": "string", "value": "~ € ÿ ퟿  ï¿¿ ð€€ ô¿¿"},
"not_escaped_string": {
"type": "string",
"value": "\\u0000 \\u0008 \\u000c \\U00000041 \\u007f \\u0080 \\u00ff \\ud7ff \\ue000 \\uffff \\U00010000 \\U0010ffff"
}
}
want:
{
"basic_string": {"type": "string", "value": "~ € ÿ ퟿  ï¿¿ ð€€ ô¿¿"},
"escaped_string": {"type": "string", "value": "\u0000 \b \f A € ÿ ퟿  ï¿¿ ð€€ ô¿¿"},
"literal_string": {"type": "string", "value": "~ € ÿ ퟿  ï¿¿ ð€€ ô¿¿"},
"not_escaped_string": {
"type": "string",
"value": "\\u0000 \\u0008 \\u000c \\U00000041 \\u007f \\u0080 \\u00ff \\ud7ff \\ue000 \\uffff \\U00010000 \\U0010ffff"
}
}
FAIL valid/string/raw-multiline
error: Uncaught (in promise) SyntaxError: Parse error on line 22, column 5: Single-line string cannot contain EOL
throw new SyntaxError(createParseErrorMessage(scanner, error.message));
^
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/_parser.ts:753:15
at parse (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/parse.ts:26:24)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/deno-toml-decoder.ts:38:9
at eventLoopTick (ext:core/01_core.js:178:7)
Exit 1
input sent to parser-cmd:
# Single ' should be allowed.
oneline = '''This string has a ' quote character.'''
# A newline immediately following the opening delimiter will be trimmed.
firstnl = '''
This string has a ' quote character.'''
# All other whitespace and newline characters remain intact.
multiline = '''
This string
has ' a quote character
and more than
one newline
in it.'''
# Tab character in literal string does not need to be escaped
multiline_with_tab = '''First line
Followed by a tab'''
this-str-has-apostrophes='''' there's one already
'' two more
'''''
output from parser-cmd (stderr):
error: Uncaught (in promise) SyntaxError: Parse error on line 22, column 5: Single-line string cannot contain EOL
throw new SyntaxError(createParseErrorMessage(scanner, error.message));
^
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/_parser.ts:753:15
at parse (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/parse.ts:26:24)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/deno-toml-decoder.ts:38:9
at eventLoopTick (ext:core/01_core.js:178:7)
Exit 1
want:
FAIL valid/string/unicode-escape
Values for key "c" don't match:
Expected: c
Your encoder: 63
input sent to parser-cmd:
delta-1 = "\u03B4"
delta-2 = "\U000003B4"
a = "\u0061"
b = "\u0062"
c = "\U00000063"
null-1 = "\u0000"
null-2 = "\U00000000"
ml-delta-1 = """\u03B4"""
ml-delta-2 = """\U000003B4"""
ml-a = """\u0061"""
ml-b = """\u0062"""
ml-c = """\U00000063"""
ml-null-1 = """\u0000"""
ml-null-2 = """\U00000000"""
output from parser-cmd (stdout):
{
"a": {"type": "string", "value": "a"},
"b": {"type": "string", "value": "b"},
"c": {"type": "string", "value": "\u000063"},
"delta-1": {"type": "string", "value": "δ"},
"delta-2": {"type": "string", "value": "\u0003B4"},
"ml-a": {"type": "string", "value": "a"},
"ml-b": {"type": "string", "value": "b"},
"ml-c": {"type": "string", "value": "\u000063"},
"ml-delta-1": {"type": "string", "value": "δ"},
"ml-delta-2": {"type": "string", "value": "\u0003B4"},
"ml-null-1": {"type": "string", "value": "\u0000"},
"ml-null-2": {"type": "string", "value": "\u000000"},
"null-1": {"type": "string", "value": "\u0000"},
"null-2": {"type": "string", "value": "\u000000"}
}
want:
{
"a": {"type": "string", "value": "a"},
"b": {"type": "string", "value": "b"},
"c": {"type": "string", "value": "c"},
"delta-1": {"type": "string", "value": "δ"},
"delta-2": {"type": "string", "value": "δ"},
"ml-a": {"type": "string", "value": "a"},
"ml-b": {"type": "string", "value": "b"},
"ml-c": {"type": "string", "value": "c"},
"ml-delta-1": {"type": "string", "value": "δ"},
"ml-delta-2": {"type": "string", "value": "δ"},
"ml-null-1": {"type": "string", "value": "\u0000"},
"ml-null-2": {"type": "string", "value": "\u0000"},
"null-1": {"type": "string", "value": "\u0000"},
"null-2": {"type": "string", "value": "\u0000"}
}
FAIL valid/table/array-implicit-and-explicit-after
error: Uncaught (in promise) SyntaxError: Parse error on line 6, column 0: Cannot parse the TOML: key length is not a positive number
throw new SyntaxError(createParseErrorMessage(scanner, error.message));
^
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/_parser.ts:753:15
at parse (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/parse.ts:26:24)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/deno-toml-decoder.ts:38:9
at eventLoopTick (ext:core/01_core.js:178:7)
Exit 1
input sent to parser-cmd:
[[a.b]]
x = 1
[a]
y = 2
output from parser-cmd (stderr):
error: Uncaught (in promise) SyntaxError: Parse error on line 6, column 0: Cannot parse the TOML: key length is not a positive number
throw new SyntaxError(createParseErrorMessage(scanner, error.message));
^
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/_parser.ts:753:15
at parse (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/parse.ts:26:24)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/deno-toml-decoder.ts:38:9
at eventLoopTick (ext:core/01_core.js:178:7)
Exit 1
want:
FAIL valid/table/without-super
error: Uncaught (in promise) SyntaxError: Parse error on line 6, column 0: Cannot parse the TOML: key length is not a positive number
throw new SyntaxError(createParseErrorMessage(scanner, error.message));
^
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/_parser.ts:753:15
at parse (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/parse.ts:26:24)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/deno-toml-decoder.ts:38:9
Exit 1
input sent to parser-cmd:
# [x] you
# [x.y] don't
# [x.y.z] need these
[x.y.z.w] # for this to work
[x] # defining a super-table afterwards is ok
output from parser-cmd (stderr):
error: Uncaught (in promise) SyntaxError: Parse error on line 6, column 0: Cannot parse the TOML: key length is not a positive number
throw new SyntaxError(createParseErrorMessage(scanner, error.message));
^
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/_parser.ts:753:15
at parse (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/parse.ts:26:24)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/deno-toml-decoder.ts:38:9
Exit 1
want:
FAIL valid/table/without-super-with-values
error: Uncaught (in promise) SyntaxError: Parse error on line 10, column 0: Cannot parse the TOML: key length is not a positive number
throw new SyntaxError(createParseErrorMessage(scanner, error.message));
^
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/_parser.ts:753:15
at parse (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/parse.ts:26:24)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/deno-toml-decoder.ts:38:9
at eventLoopTick (ext:core/01_core.js:178:7)
Exit 1
input sent to parser-cmd:
# [x] you
# [x.y] don't
# [x.y.z] need these
[x.y.z.w] # for this to work
a = 1
b = 2
[x] # defining a super-table afterwards is ok
c = 3
d = 4
output from parser-cmd (stderr):
error: Uncaught (in promise) SyntaxError: Parse error on line 10, column 0: Cannot parse the TOML: key length is not a positive number
throw new SyntaxError(createParseErrorMessage(scanner, error.message));
^
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/_parser.ts:753:15
at parse (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/parse.ts:26:24)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/deno-toml-decoder.ts:38:9
at eventLoopTick (ext:core/01_core.js:178:7)
Exit 1
want:
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": "float", "value": "1"},
"c": {
"foo": {"type": "float", "value": "1"}
}
}]
}
want:
Exit code 1
FAIL invalid/array/tables-1
Expected an error, but no error was reported.
input sent to parser-cmd:
# INVALID TOML DOC
fruit = []
[[fruit]] # Not allowed
output from parser-cmd (stdout):
{
"fruit": [{}]
}
want:
Exit code 1
FAIL invalid/control/comment-cr
Expected an error, but no error was reported.
input sent to parser-cmd:
comment-cr = "Carriage return in comment" #
a=1
output from parser-cmd (stdout):
{
"comment-cr": {"type": "string", "value": "Carriage return in comment"}
}
want:
Exit code 1
FAIL invalid/control/comment-del
Expected an error, but no error was reported.
input sent to parser-cmd:
comment-del = "0x7f" #
output from parser-cmd (stdout):
{
"comment-del": {"type": "string", "value": "0x7f"}
}
want:
Exit code 1
FAIL invalid/control/comment-ff
Expected an error, but no error was reported.
input sent to parser-cmd:
comment-ff = "0x7f" #
output from parser-cmd (stdout):
{
"comment-ff": {"type": "string", "value": "0x7f"}
}
want:
Exit code 1
FAIL invalid/control/comment-lf
Expected an error, but no error was reported.
input sent to parser-cmd:
comment-lf = "ctrl-P" #
output from parser-cmd (stdout):
{
"comment-lf": {"type": "string", "value": "ctrl-P"}
}
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/comment-us
Expected an error, but no error was reported.
input sent to parser-cmd:
comment-us = "ctrl-_" #
output from parser-cmd (stdout):
{
"comment-us": {"type": "string", "value": "ctrl-_"}
}
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/multi-del
Expected an error, but no error was reported.
input sent to parser-cmd:
multi-del = """null"""
output from parser-cmd (stdout):
{
"multi-del": {"type": "string", "value": "null"}
}
want:
Exit code 1
FAIL invalid/control/multi-lf
Expected an error, but no error was reported.
input sent to parser-cmd:
multi-lf = """null"""
output from parser-cmd (stdout):
{
"multi-lf": {"type": "string", "value": "null\u0010"}
}
want:
Exit code 1
FAIL invalid/control/multi-null
Expected an error, but no error was reported.
input sent to parser-cmd:
multi-null = """null """
output from parser-cmd (stdout):
{
"multi-null": {"type": "string", "value": "null\u0000"}
}
want:
Exit code 1
FAIL invalid/control/multi-us
Expected an error, but no error was reported.
input sent to parser-cmd:
multi-us = """null"""
output from parser-cmd (stdout):
{
"multi-us": {"type": "string", "value": "null\u001f"}
}
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/control/rawmulti-del
Expected an error, but no error was reported.
input sent to parser-cmd:
rawmulti-del = '''null'''
output from parser-cmd (stdout):
{
"rawmulti-del": {"type": "string", "value": "null"}
}
want:
Exit code 1
FAIL invalid/control/rawmulti-lf
Expected an error, but no error was reported.
input sent to parser-cmd:
rawmulti-lf = '''null'''
output from parser-cmd (stdout):
{
"rawmulti-lf": {"type": "string", "value": "null\u0010"}
}
want:
Exit code 1
FAIL invalid/control/rawmulti-null
Expected an error, but no error was reported.
input sent to parser-cmd:
rawmulti-null = '''null '''
output from parser-cmd (stdout):
{
"rawmulti-null": {"type": "string", "value": "null\u0000"}
}
want:
Exit code 1
FAIL invalid/control/rawmulti-us
Expected an error, but no error was reported.
input sent to parser-cmd:
rawmulti-us = '''null'''
output from parser-cmd (stdout):
{
"rawmulti-us": {"type": "string", "value": "null\u001f"}
}
want:
Exit code 1
FAIL invalid/control/rawstring-cr
Expected an error, but no error was reported.
input sent to parser-cmd:
rawstring-cr = 'null
'
output from parser-cmd (stdout):
{
"rawstring-cr": {"type": "string", "value": "null\r"}
}
want:
Exit code 1
FAIL invalid/control/rawstring-del
Expected an error, but no error was reported.
input sent to parser-cmd:
rawstring-del = 'null'
output from parser-cmd (stdout):
{
"rawstring-del": {"type": "string", "value": "null"}
}
want:
Exit code 1
FAIL invalid/control/rawstring-lf
Expected an error, but no error was reported.
input sent to parser-cmd:
rawstring-lf = 'null'
output from parser-cmd (stdout):
{
"rawstring-lf": {"type": "string", "value": "null\u0010"}
}
want:
Exit code 1
FAIL invalid/control/rawstring-null
Expected an error, but no error was reported.
input sent to parser-cmd:
rawstring-null = 'null '
output from parser-cmd (stdout):
{
"rawstring-null": {"type": "string", "value": "null\u0000"}
}
want:
Exit code 1
FAIL invalid/control/rawstring-us
Expected an error, but no error was reported.
input sent to parser-cmd:
rawstring-us = 'null'
output from parser-cmd (stdout):
{
"rawstring-us": {"type": "string", "value": "null\u001f"}
}
want:
Exit code 1
FAIL invalid/control/string-bs
Expected an error, but no error was reported.
input sent to parser-cmd:
string-bs = "backspace"
output from parser-cmd (stdout):
{
"string-bs": {"type": "string", "value": "backspace\b"}
}
want:
Exit code 1
FAIL invalid/control/string-cr
Expected an error, but no error was reported.
input sent to parser-cmd:
string-cr = "null
"
output from parser-cmd (stdout):
{
"string-cr": {"type": "string", "value": "null\r"}
}
want:
Exit code 1
FAIL invalid/control/string-del
Expected an error, but no error was reported.
input sent to parser-cmd:
string-del = "null"
output from parser-cmd (stdout):
{
"string-del": {"type": "string", "value": "null"}
}
want:
Exit code 1
FAIL invalid/control/string-lf
Expected an error, but no error was reported.
input sent to parser-cmd:
string-lf = "null"
output from parser-cmd (stdout):
{
"string-lf": {"type": "string", "value": "null\u0010"}
}
want:
Exit code 1
FAIL invalid/control/string-null
Expected an error, but no error was reported.
input sent to parser-cmd:
string-null = "null "
output from parser-cmd (stdout):
{
"string-null": {"type": "string", "value": "null\u0000"}
}
want:
Exit code 1
FAIL invalid/control/string-us
Expected an error, but no error was reported.
input sent to parser-cmd:
string-us = "null"
output from parser-cmd (stdout):
{
"string-us": {"type": "string", "value": "null\u001f"}
}
want:
Exit code 1
FAIL invalid/datetime/feb-29
Expected an error, but no error was reported.
input sent to parser-cmd:
"not a leap year" = 2100-02-29T15:15:15Z
output from parser-cmd (stdout):
{
"not a leap year": {"type": "datetime", "value": "2100-03-01T15:15:15.000Z"}
}
want:
Exit code 1
FAIL invalid/datetime/feb-30
Expected an error, but no error was reported.
input sent to parser-cmd:
"only 28 or 29 days in february" = 1988-02-30T15:15:15Z
output from parser-cmd (stdout):
{
"only 28 or 29 days in february": {"type": "datetime", "value": "1988-03-01T15:15:15.000Z"}
}
want:
Exit code 1
FAIL invalid/datetime/hour-over
Expected an error, but no error was reported.
input sent to parser-cmd:
# time-hour = 2DIGIT ; 00-23
d = 2006-01-01T24:00:00-00:00
output from parser-cmd (stdout):
{
"d": {"type": "datetime", "value": "2006-01-02T00:00:00.000Z"}
}
want:
Exit code 1
FAIL invalid/datetime/no-secs
Expected an error, but no error was reported.
input sent to parser-cmd:
# No seconds in time.
no-secs = 1987-07-05T17:45Z
output from parser-cmd (stdout):
{
"no-secs": {"type": "datetime", "value": "1987-07-05T17:45:00.000Z"}
}
want:
Exit code 1
FAIL invalid/datetime/offset-overflow-hour
Expected an error, but no error was reported.
input sent to parser-cmd:
# Hour must be 00-24
d = 1985-06-18 17:04:07+25:00
output from parser-cmd (stdout):
{
"d": {"type": "datetime", "value": "1985-06-17T16:04:07.000Z"}
}
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/bad-utf8-in-multiline
Expected an error, but no error was reported.
input sent to parser-cmd:
# The following line contains an invalid UTF-8 sequence.
bad = """Ã"""
output from parser-cmd (stdout):
{
"bad": {"type": "string", "value": "�"}
}
want:
Exit code 1
FAIL invalid/encoding/bad-utf8-in-multiline-literal
Expected an error, but no error was reported.
input sent to parser-cmd:
# The following line contains an invalid UTF-8 sequence.
bad = '''Ã'''
output from parser-cmd (stdout):
{
"bad": {"type": "string", "value": "�"}
}
want:
Exit code 1
FAIL invalid/encoding/bad-utf8-in-string
Expected an error, but no error was reported.
input sent to parser-cmd:
# The following line contains an invalid UTF-8 sequence.
bad = "Ã"
output from parser-cmd (stdout):
{
"bad": {"type": "string", "value": "�"}
}
want:
Exit code 1
FAIL invalid/encoding/bad-utf8-in-string-literal
Expected an error, but no error was reported.
input sent to parser-cmd:
# The following line contains an invalid UTF-8 sequence.
bad = 'Ã'
output from parser-cmd (stdout):
{
"bad": {"type": "string", "value": "�"}
}
want:
Exit code 1
FAIL invalid/float/exp-double-us
Expected an error, but no error was reported.
input sent to parser-cmd:
exp-double-us = 1e__23
output from parser-cmd (stdout):
{
"exp-double-us": {"type": "float", "value": "1e+23"}
}
want:
Exit code 1
FAIL invalid/float/exp-leading-us
Expected an error, but no error was reported.
input sent to parser-cmd:
exp-leading-us = 1e_23
output from parser-cmd (stdout):
{
"exp-leading-us": {"type": "float", "value": "1e+23"}
}
want:
Exit code 1
FAIL invalid/float/exp-trailing-us
Expected an error, but no error was reported.
input sent to parser-cmd:
exp-trailing-us = 1e23_
output from parser-cmd (stdout):
{
"exp-trailing-us": {"type": "float", "value": "1e+23"}
}
want:
Exit code 1
FAIL invalid/float/exp-trailing-us-1
Expected an error, but no error was reported.
input sent to parser-cmd:
exp-trailing-us-1 = 1_e2
output from parser-cmd (stdout):
{
"exp-trailing-us-1": {"type": "float", "value": "100"}
}
want:
Exit code 1
FAIL invalid/float/exp-trailing-us-2
Expected an error, but no error was reported.
input sent to parser-cmd:
exp-trailing-us-2 = 1.2_e2
output from parser-cmd (stdout):
{
"exp-trailing-us-2": {"type": "float", "value": "120"}
}
want:
Exit code 1
FAIL invalid/float/leading-us
Expected an error, but no error was reported.
input sent to parser-cmd:
leading-us = _1.2
output from parser-cmd (stdout):
{
"leading-us": {"type": "float", "value": "1.2"}
}
want:
Exit code 1
FAIL invalid/float/leading-zero
Expected an error, but no error was reported.
input sent to parser-cmd:
leading-zero = 03.14
output from parser-cmd (stdout):
{
"leading-zero": {"type": "float", "value": "3.14"}
}
want:
Exit code 1
FAIL invalid/float/leading-zero-neg
Expected an error, but no error was reported.
input sent to parser-cmd:
leading-zero-neg = -03.14
output from parser-cmd (stdout):
{
"leading-zero-neg": {"type": "float", "value": "-3.14"}
}
want:
Exit code 1
FAIL invalid/float/leading-zero-plus
Expected an error, but no error was reported.
input sent to parser-cmd:
leading-zero-plus = +03.14
output from parser-cmd (stdout):
{
"leading-zero-plus": {"type": "float", "value": "3.14"}
}
want:
Exit code 1
FAIL invalid/float/trailing-us
Expected an error, but no error was reported.
input sent to parser-cmd:
trailing-us = 1.2_
output from parser-cmd (stdout):
{
"trailing-us": {"type": "float", "value": "1.2"}
}
want:
Exit code 1
FAIL invalid/float/trailing-us-exp-1
Expected an error, but no error was reported.
input sent to parser-cmd:
trailing-us-exp-1 = 1_e2
output from parser-cmd (stdout):
{
"trailing-us-exp-1": {"type": "float", "value": "100"}
}
want:
Exit code 1
FAIL invalid/float/trailing-us-exp-2
Expected an error, but no error was reported.
input sent to parser-cmd:
trailing-us-exp-2 = 1.2_e2
output from parser-cmd (stdout):
{
"trailing-us-exp-2": {"type": "float", "value": "120"}
}
want:
Exit code 1
FAIL invalid/float/us-after-point
Expected an error, but no error was reported.
input sent to parser-cmd:
us-after-point = 1._2
output from parser-cmd (stdout):
{
"us-after-point": {"type": "float", "value": "1.2"}
}
want:
Exit code 1
FAIL invalid/float/us-before-point
Expected an error, but no error was reported.
input sent to parser-cmd:
us-before-point = 1_.2
output from parser-cmd (stdout):
{
"us-before-point": {"type": "float", "value": "1.2"}
}
want:
Exit code 1
FAIL invalid/inline-table/duplicate-key-1
Expected an error, but no error was reported.
input sent to parser-cmd:
# Duplicate keys within an inline table are invalid
a={b=1, b=2}
output from parser-cmd (stdout):
{
"a": {
"b": {"type": "float", "value": "2"}
}
}
want:
Exit code 1
FAIL invalid/inline-table/duplicate-key-2
Expected an error, but no error was reported.
input sent to parser-cmd:
table1 = { table2.dupe = 1, table2.dupe = 2 }
output from parser-cmd (stdout):
{
"table1": {
"table2": {
"dupe": {"type": "float", "value": "2"}
}
}
}
want:
Exit code 1
FAIL invalid/inline-table/duplicate-key-3
Expected an error, but no error was reported.
input sent to parser-cmd:
tbl = { fruit = { apple.color = "red" }, fruit.apple.texture = { smooth = true } }
output from parser-cmd (stdout):
{
"tbl": {
"fruit": {
"apple": {
"color": {"type": "string", "value": "red"},
"texture": {
"smooth": {"type": "bool", "value": "true"}
}
}
}
}
}
want:
Exit code 1
FAIL invalid/inline-table/duplicate-key-4
Expected an error, but no error was reported.
input sent to parser-cmd:
tbl = { a.b = "a_b", a.b.c = "a_b_c" }
output from parser-cmd (stdout):
{
"tbl": {
"a": {
"b": {
"c": {"type": "string", "value": "a_b_c"}
}
}
}
}
want:
Exit code 1
FAIL invalid/inline-table/overwrite-01
Expected an error, but no error was reported.
input sent to parser-cmd:
a.b=0
# Since table "a" is already defined, it can't be replaced by an inline table.
a={}
output from parser-cmd (stdout):
{
"a": {
"b": {"type": "float", "value": "0"}
}
}
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/overwrite-03
Expected an error, but no error was reported.
input sent to parser-cmd:
a = { b = 1 }
a.b = 2
output from parser-cmd (stdout):
{
"a": {
"b": {"type": "float", "value": "2"}
}
}
want:
Exit code 1
FAIL invalid/inline-table/overwrite-06
Expected an error, but no error was reported.
input sent to parser-cmd:
a = { b = 1, b.c = 2 }
output from parser-cmd (stdout):
{
"a": {
"b": {
"c": {"type": "float", "value": "2"}
}
}
}
want:
Exit code 1
FAIL invalid/inline-table/overwrite-07
Expected an error, but no error was reported.
input sent to parser-cmd:
tab = { inner.table = [{}], inner.table.val = "bad" }
output from parser-cmd (stdout):
{
"tab": {
"inner": {
"table": {
"val": {"type": "string", "value": "bad"}
}
}
}
}
want:
Exit code 1
FAIL invalid/inline-table/overwrite-08
Expected an error, but no error was reported.
input sent to parser-cmd:
tab = { inner = { dog = "best" }, inner.cat = "worst" }
output from parser-cmd (stdout):
{
"tab": {
"inner": {
"cat": {"type": "string", "value": "worst"},
"dog": {"type": "string", "value": "best"}
}
}
}
want:
Exit code 1
FAIL invalid/inline-table/overwrite-10
Expected an error, but no error was reported.
input sent to parser-cmd:
# Set implicit "b", overwrite "b" (illegal!) and then set another implicit.
#
# Caused panic: https://github.com/BurntSushi/toml/issues/403
a = {b.a = 1, b = 2, b.c = 3}
output from parser-cmd (stdout):
{
"a": {
"b": {
"c": {"type": "float", "value": "3"}
}
}
}
want:
Exit code 1
FAIL invalid/integer/capital-hex
Expected an error, but no error was reported.
input sent to parser-cmd:
capital-hex = 0X1
output from parser-cmd (stdout):
{
"capital-hex": {"type": "float", "value": "1"}
}
want:
Exit code 1
FAIL invalid/integer/double-us
Expected an error, but no error was reported.
input sent to parser-cmd:
double-us = 1__23
output from parser-cmd (stdout):
{
"double-us": {"type": "float", "value": "123"}
}
want:
Exit code 1
FAIL invalid/integer/leading-us
Expected an error, but no error was reported.
input sent to parser-cmd:
leading-us = _123
output from parser-cmd (stdout):
{
"leading-us": {"type": "float", "value": "123"}
}
want:
Exit code 1
FAIL invalid/integer/leading-zero-1
Expected an error, but no error was reported.
input sent to parser-cmd:
leading-zero-1 = 01
output from parser-cmd (stdout):
{
"leading-zero-1": {"type": "float", "value": "1"}
}
want:
Exit code 1
FAIL invalid/integer/leading-zero-2
Expected an error, but no error was reported.
input sent to parser-cmd:
leading-zero-2 = 00
output from parser-cmd (stdout):
{
"leading-zero-2": {"type": "float", "value": "0"}
}
want:
Exit code 1
FAIL invalid/integer/leading-zero-3
Expected an error, but no error was reported.
input sent to parser-cmd:
leading-zero-3 = 0_0
output from parser-cmd (stdout):
{
"leading-zero-3": {"type": "float", "value": "0"}
}
want:
Exit code 1
FAIL invalid/integer/leading-zero-sign-1
Expected an error, but no error was reported.
input sent to parser-cmd:
leading-zero-sign-1 = -01
output from parser-cmd (stdout):
{
"leading-zero-sign-1": {"type": "float", "value": "-1"}
}
want:
Exit code 1
FAIL invalid/integer/leading-zero-sign-2
Expected an error, but no error was reported.
input sent to parser-cmd:
leading-zero-sign-2 = +01
output from parser-cmd (stdout):
{
"leading-zero-sign-2": {"type": "float", "value": "1"}
}
want:
Exit code 1
FAIL invalid/integer/leading-zero-sign-3
Expected an error, but no error was reported.
input sent to parser-cmd:
leading-zero-sign-3 = +0_1
output from parser-cmd (stdout):
{
"leading-zero-sign-3": {"type": "float", "value": "1"}
}
want:
Exit code 1
FAIL invalid/integer/trailing-us
Expected an error, but no error was reported.
input sent to parser-cmd:
trailing-us = 123_
output from parser-cmd (stdout):
{
"trailing-us": {"type": "float", "value": "123"}
}
want:
Exit code 1
FAIL invalid/integer/trailing-us-bin
Expected an error, but no error was reported.
input sent to parser-cmd:
trailing-us-bin = 0b1_
output from parser-cmd (stdout):
{
"trailing-us-bin": {"type": "float", "value": "1"}
}
want:
Exit code 1
FAIL invalid/integer/trailing-us-hex
Expected an error, but no error was reported.
input sent to parser-cmd:
trailing-us-hex = 0x1_
output from parser-cmd (stdout):
{
"trailing-us-hex": {"type": "float", "value": "1"}
}
want:
Exit code 1
FAIL invalid/integer/trailing-us-oct
Expected an error, but no error was reported.
input sent to parser-cmd:
trailing-us-oct = 0o1_
output from parser-cmd (stdout):
{
"trailing-us-oct": {"type": "float", "value": "1"}
}
want:
Exit code 1
FAIL invalid/integer/us-after-bin
Expected an error, but no error was reported.
input sent to parser-cmd:
us-after-bin = 0b_1
output from parser-cmd (stdout):
{
"us-after-bin": {"type": "float", "value": "1"}
}
want:
Exit code 1
FAIL invalid/integer/us-after-hex
Expected an error, but no error was reported.
input sent to parser-cmd:
us-after-hex = 0x_1
output from parser-cmd (stdout):
{
"us-after-hex": {"type": "float", "value": "1"}
}
want:
Exit code 1
FAIL invalid/integer/us-after-oct
Expected an error, but no error was reported.
input sent to parser-cmd:
us-after-oct = 0o_1
output from parser-cmd (stdout):
{
"us-after-oct": {"type": "float", "value": "1"}
}
want:
Exit code 1
FAIL invalid/key/after-array
Expected an error, but no error was reported.
input sent to parser-cmd:
[[agencies]] owner = "S Cjelli"
output from parser-cmd (stdout):
{
"agencies": [{
"owner": {"type": "string", "value": "S Cjelli"}
}]
}
want:
Exit code 1
FAIL invalid/key/after-table
Expected an error, but no error was reported.
input sent to parser-cmd:
[error] this = "should not be here"
output from parser-cmd (stdout):
{
"error": {
"this": {"type": "string", "value": "should not be here"}
}
}
want:
Exit code 1
FAIL invalid/key/after-value
Expected an error, but no error was reported.
input sent to parser-cmd:
first = "Tom" last = "Preston-Werner" # INVALID
output from parser-cmd (stdout):
{
"first": {"type": "string", "value": "Tom"},
"last": {"type": "string", "value": "Preston-Werner"}
}
want:
Exit code 1
FAIL invalid/key/dotted-redefine-table-1
Expected an error, but no error was reported.
input sent to parser-cmd:
a = false
a.b = true
output from parser-cmd (stdout):
{
"a": {
"b": {"type": "bool", "value": "true"}
}
}
want:
Exit code 1
FAIL invalid/key/dotted-redefine-table-2
Expected an error, but no error was reported.
input sent to parser-cmd:
# Defined a.b as int
a.b = 1
# Tries to access it as table: error
a.b.c = 2
output from parser-cmd (stdout):
{
"a": {
"b": {
"c": {"type": "float", "value": "2"}
}
}
}
want:
Exit code 1
FAIL invalid/key/duplicate-keys-1
Expected an error, but no error was reported.
input sent to parser-cmd:
name = "Tom"
name = "Pradyun"
output from parser-cmd (stdout):
{
"name": {"type": "string", "value": "Pradyun"}
}
want:
Exit code 1
FAIL invalid/key/duplicate-keys-2
Expected an error, but no error was reported.
input sent to parser-cmd:
dupe = false
dupe = true
output from parser-cmd (stdout):
{
"dupe": {"type": "bool", "value": "true"}
}
want:
Exit code 1
FAIL invalid/key/duplicate-keys-3
Expected an error, but no error was reported.
input sent to parser-cmd:
spelling = "favorite"
"spelling" = "favourite"
output from parser-cmd (stdout):
{
"spelling": {"type": "string", "value": "favourite"}
}
want:
Exit code 1
FAIL invalid/key/duplicate-keys-4
Expected an error, but no error was reported.
input sent to parser-cmd:
spelling = "favorite"
'spelling' = "favourite"
output from parser-cmd (stdout):
{
"spelling": {"type": "string", "value": "favourite"}
}
want:
Exit code 1
FAIL invalid/key/no-eol
Expected an error, but no error was reported.
input sent to parser-cmd:
a = 1 b = 2
output from parser-cmd (stdout):
{
"a": {"type": "float", "value": "1"},
"b": {"type": "float", "value": "2"}
}
want:
Exit code 1
FAIL invalid/local-date/feb-29
Expected an error, but no error was reported.
input sent to parser-cmd:
"not a leap year" = 2100-02-29
output from parser-cmd (stdout):
{
"not a leap year": {"type": "datetime", "value": "2100-03-01T00:00:00.000Z"}
}
want:
Exit code 1
FAIL invalid/local-date/feb-30
Expected an error, but no error was reported.
input sent to parser-cmd:
"only 28 or 29 days in february" = 1988-02-30
output from parser-cmd (stdout):
{
"only 28 or 29 days in february": {"type": "datetime", "value": "1988-03-01T00:00:00.000Z"}
}
want:
Exit code 1
FAIL invalid/local-datetime/feb-29
Expected an error, but no error was reported.
input sent to parser-cmd:
"not a leap year" = 2100-02-29T15:15:15
output from parser-cmd (stdout):
{
"not a leap year": {"type": "datetime", "value": "2100-03-01T15:15:15.000Z"}
}
want:
Exit code 1
FAIL invalid/local-datetime/feb-30
Expected an error, but no error was reported.
input sent to parser-cmd:
"only 28 or 29 days in february" = 1988-02-30T15:15:15
output from parser-cmd (stdout):
{
"only 28 or 29 days in february": {"type": "datetime", "value": "1988-03-01T15:15:15.000Z"}
}
want:
Exit code 1
FAIL invalid/local-datetime/hour-over
Expected an error, but no error was reported.
input sent to parser-cmd:
# time-hour = 2DIGIT ; 00-23
d = 2006-01-01T24:00:00
output from parser-cmd (stdout):
{
"d": {"type": "datetime", "value": "2006-01-02T00:00:00.000Z"}
}
want:
Exit code 1
FAIL invalid/local-datetime/no-secs
Expected an error, but no error was reported.
input sent to parser-cmd:
# No seconds in time.
no-secs = 1987-07-05T17:45
output from parser-cmd (stdout):
{
"no-secs": {"type": "datetime", "value": "1987-07-05T16:45:00.000Z"}
}
want:
Exit code 1
FAIL invalid/local-time/hour-over
Expected an error, but no error was reported.
input sent to parser-cmd:
# time-hour = 2DIGIT ; 00-23
d = 24:00:00
output from parser-cmd (stdout):
{
"d": {"type": "string", "value": "24:00:00"}
}
want:
Exit code 1
FAIL invalid/local-time/minute-over
Expected an error, but no error was reported.
input sent to parser-cmd:
# time-minute = 2DIGIT ; 00-59
d = 00:60:00
output from parser-cmd (stdout):
{
"d": {"type": "string", "value": "00:60:00"}
}
want:
Exit code 1
FAIL invalid/local-time/second-over
Expected an error, but no error was reported.
input sent to parser-cmd:
# time-second = 2DIGIT ; 00-58, 00-59, 00-60 based on leap second
# ; rules
d = 00:00:61
output from parser-cmd (stdout):
{
"d": {"type": "string", "value": "00:00:61"}
}
want:
Exit code 1
FAIL invalid/spec/inline-table-2-0
Expected an error, but no error was reported.
input sent to parser-cmd:
[product]
type = { name = "Nail" }
type.edible = false # INVALID
output from parser-cmd (stdout):
{
"product": {
"type": {
"edible": {"type": "bool", "value": "false"},
"name": {"type": "string", "value": "Nail"}
}
}
}
want:
Exit code 1
FAIL invalid/spec/inline-table-3-0
Expected an error, but no error was reported.
input sent to parser-cmd:
[product]
type.name = "Nail"
type = { edible = false } # INVALID
output from parser-cmd (stdout):
{
"product": {
"type": {
"edible": {"type": "bool", "value": "false"},
"name": {"type": "string", "value": "Nail"}
}
}
}
want:
Exit code 1
FAIL invalid/string/bad-uni-esc-3
Expected an error, but no error was reported.
input sent to parser-cmd:
bad-uni-esc-3 = "val\U0000000"
output from parser-cmd (stdout):
{
"bad-uni-esc-3": {"type": "string", "value": "val\u00000"}
}
want:
Exit code 1
FAIL invalid/string/bad-uni-esc-6
Expected an error, but no error was reported.
input sent to parser-cmd:
bad-uni-esc-6 = "This string contains a non scalar unicode codepoint \uD801"
output from parser-cmd (stdout):
{
"bad-uni-esc-6": {"type": "string", "value": "This string contains a non scalar unicode codepoint �"}
}
want:
Exit code 1
FAIL invalid/string/bad-uni-esc-7
Expected an error, but no error was reported.
input sent to parser-cmd:
bad-uni-esc-7 = "\uabag"
output from parser-cmd (stdout):
{
"bad-uni-esc-7": {"type": "string", "value": "઺"}
}
want:
Exit code 1
FAIL invalid/string/basic-multiline-out-of-range-unicode-escape-2
Expected an error, but no error was reported.
input sent to parser-cmd:
a = """\U00D80000"""
output from parser-cmd (stdout):
{
"a": {"type": "string", "value": "�00"}
}
want:
Exit code 1
FAIL invalid/string/basic-out-of-range-unicode-escape-2
Expected an error, but no error was reported.
input sent to parser-cmd:
a = "\U00D80000"
output from parser-cmd (stdout):
{
"a": {"type": "string", "value": "�00"}
}
want:
Exit code 1
toml-test v2025-04-19 [./deno-toml-decoder.ts]: using embedded tests, 1 skipped
valid tests: 165 passed, 28 failed
invalid tests: 270 passed, 107 failed
==> ENCODER TESTS
FAIL valid/array/array
Type for key "comments" differs:
Expected: 1 (int64)
Your encoder: map[] (map[string]any)
input sent to parser-cmd:
{
"comments": [
{"type": "integer", "value": "1"},
{"type": "integer", "value": "2"}
],
"dates": [
{"type": "datetime", "value": "1987-07-05T17:45:00Z"},
{"type": "datetime", "value": "1979-05-27T07:32:00Z"},
{"type": "datetime", "value": "2006-06-01T11:00:00Z"}
],
"floats": [
{"type": "float", "value": "1.1"},
{"type": "float", "value": "2.1"},
{"type": "float", "value": "3.1"}
],
"ints": [
{"type": "integer", "value": "1"},
{"type": "integer", "value": "2"},
{"type": "integer", "value": "3"}
],
"strings": [
{"type": "string", "value": "a"},
{"type": "string", "value": "b"},
{"type": "string", "value": "c"}
]
}
output from parser-cmd (stdout):
dates = ["1987-07-05T17:45:00.000Z","1979-05-27T07:32:00.000Z","2006-06-01T11:00:00.000Z"]
floats = [1.1,2.1,3.1]
strings = ["a","b","c"]
[[comments]]
[[comments]]
[[ints]]
[[ints]]
[[ints]]
want:
ints = [1, 2, 3, ]
floats = [1.1, 2.1, 3.1]
strings = ["a", "b", "c"]
dates = [
1987-07-05T17:45:00Z,
1979-05-27T07:32:00Z,
2006-06-01T11:00:00Z,
]
comments = [
1,
2, #this is ok
]
FAIL valid/array/array-subtables
Could not find key "arr.subtab.val" in encoder output
input sent to parser-cmd:
{
"arr": [
{
"subtab": {
"val": {"type": "integer", "value": "1"}
}
},
{
"subtab": {
"val": {"type": "integer", "value": "2"}
}
}
]
}
output from parser-cmd (stdout):
[[arr]]
[arr.subtab]
[[arr]]
[arr.subtab]
want:
[[arr]]
[arr.subtab]
val=1
[[arr]]
[arr.subtab]
val=2
FAIL valid/array/hetergeneous
error: Uncaught (in promise) Error: should never reach
throw new Error("should never reach");
^
at Dumper.#printAsInlineValue (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:161:11)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:147:60
at Array.map ()
at Dumper.#printAsInlineValue (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:147:25)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:87:64
at Array.map ()
at Dumper.#printObject (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:87:29)
at Dumper.dump (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:45:36)
at stringify (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:291:26)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/deno-toml-encoder.ts:39:22
Exit 1
input sent to parser-cmd:
{
"mixed": [
[
{"type": "integer", "value": "1"},
{"type": "integer", "value": "2"}
],
[
{"type": "string", "value": "a"},
{"type": "string", "value": "b"}
],
[
{"type": "float", "value": "1.1"},
{"type": "float", "value": "2.1"}
]
]
}
output from parser-cmd (stderr):
error: Uncaught (in promise) Error: should never reach
throw new Error("should never reach");
^
at Dumper.#printAsInlineValue (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:161:11)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:147:60
at Array.map ()
at Dumper.#printAsInlineValue (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:147:25)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:87:64
at Array.map ()
at Dumper.#printObject (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:87:29)
at Dumper.dump (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:45:36)
at stringify (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:291:26)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/deno-toml-encoder.ts:39:22
Exit 1
want:
FAIL valid/array/mixed-int-array
error: Uncaught (in promise) Error: should never reach
throw new Error("should never reach");
^
at Dumper.#printAsInlineValue (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:161:11)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:87:64
at Array.map ()
at Dumper.#printObject (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:87:29)
at Dumper.dump (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:45:36)
at stringify (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:291:26)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/deno-toml-encoder.ts:39:22
at eventLoopTick (ext:core/01_core.js:178:7)
Exit 1
input sent to parser-cmd:
{
"arrays-and-ints": [
{"type": "integer", "value": "1"},
[{"type": "string", "value": "Arrays are not integers."}]
]
}
output from parser-cmd (stderr):
error: Uncaught (in promise) Error: should never reach
throw new Error("should never reach");
^
at Dumper.#printAsInlineValue (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:161:11)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:87:64
at Array.map ()
at Dumper.#printObject (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:87:29)
at Dumper.dump (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:45:36)
at stringify (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:291:26)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/deno-toml-encoder.ts:39:22
at eventLoopTick (ext:core/01_core.js:178:7)
Exit 1
want:
FAIL valid/array/mixed-int-float
error: Uncaught (in promise) Error: should never reach
throw new Error("should never reach");
^
at Dumper.#printAsInlineValue (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:161:11)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:87:64
at Array.map ()
at Dumper.#printObject (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:87:29)
at Dumper.dump (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:45:36)
at stringify (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:291:26)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/deno-toml-encoder.ts:39:22
at eventLoopTick (ext:core/01_core.js:178:7)
Exit 1
input sent to parser-cmd:
{
"ints-and-floats": [
{"type": "integer", "value": "1"},
{"type": "float", "value": "1.1"}
]
}
output from parser-cmd (stderr):
error: Uncaught (in promise) Error: should never reach
throw new Error("should never reach");
^
at Dumper.#printAsInlineValue (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:161:11)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:87:64
at Array.map ()
at Dumper.#printObject (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:87:29)
at Dumper.dump (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:45:36)
at stringify (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:291:26)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/deno-toml-encoder.ts:39:22
at eventLoopTick (ext:core/01_core.js:178:7)
Exit 1
want:
FAIL valid/array/mixed-int-string
error: Uncaught (in promise) Error: should never reach
throw new Error("should never reach");
^
at Dumper.#printAsInlineValue (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:161:11)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:87:64
at Array.map ()
at Dumper.#printObject (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:87:29)
at Dumper.dump (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:45:36)
at stringify (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:291:26)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/deno-toml-encoder.ts:39:22
at eventLoopTick (ext:core/01_core.js:178:7)
Exit 1
input sent to parser-cmd:
{
"strings-and-ints": [
{"type": "string", "value": "hi"},
{"type": "integer", "value": "42"}
]
}
output from parser-cmd (stderr):
error: Uncaught (in promise) Error: should never reach
throw new Error("should never reach");
^
at Dumper.#printAsInlineValue (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:161:11)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:87:64
at Array.map ()
at Dumper.#printObject (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:87:29)
at Dumper.dump (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:45:36)
at stringify (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:291:26)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/deno-toml-encoder.ts:39:22
at eventLoopTick (ext:core/01_core.js:178:7)
Exit 1
want:
FAIL valid/array/mixed-string-table
error: Uncaught (in promise) Error: should never reach
throw new Error("should never reach");
^
at Dumper.#printAsInlineValue (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:161:11)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:87:64
at Array.map ()
at Dumper.#printObject (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:87:29)
at Dumper.dump (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:45:36)
at stringify (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:291:26)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/deno-toml-encoder.ts:39:22
at eventLoopTick (ext:core/01_core.js:178:7)
Exit 1
input sent to parser-cmd:
{
"contributors": [
{"type": "string", "value": "Foo Bar \u003cfoo@example.com\u003e"},
{
"email": {"type": "string", "value": "bazqux@example.com"},
"name": {"type": "string", "value": "Baz Qux"},
"url": {"type": "string", "value": "https://example.com/bazqux"}
}
],
"mixed": [
{
"k": {"type": "string", "value": "a"}
},
{"type": "string", "value": "b"},
{"type": "integer", "value": "1"}
]
}
output from parser-cmd (stderr):
error: Uncaught (in promise) Error: should never reach
throw new Error("should never reach");
^
at Dumper.#printAsInlineValue (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:161:11)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:87:64
at Array.map ()
at Dumper.#printObject (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:87:29)
at Dumper.dump (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:45:36)
at stringify (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:291:26)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/deno-toml-encoder.ts:39:22
at eventLoopTick (ext:core/01_core.js:178:7)
Exit 1
want:
FAIL valid/array/nested-double
error: Uncaught (in promise) Error: should never reach
throw new Error("should never reach");
^
at Dumper.#printAsInlineValue (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:161:11)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:147:60
at Array.map ()
at Dumper.#printAsInlineValue (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:147:25)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:147:60
at Array.map ()
at Dumper.#printAsInlineValue (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:147:25)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:87:64
at Array.map ()
at Dumper.#printObject (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:87:29)
Exit 1
input sent to parser-cmd:
{
"nest": [[
[{"type": "string", "value": "a"}],
[
{"type": "integer", "value": "1"},
{"type": "integer", "value": "2"},
[{"type": "integer", "value": "3"}]
]
]]
}
output from parser-cmd (stderr):
error: Uncaught (in promise) Error: should never reach
throw new Error("should never reach");
^
at Dumper.#printAsInlineValue (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:161:11)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:147:60
at Array.map ()
at Dumper.#printAsInlineValue (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:147:25)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:147:60
at Array.map ()
at Dumper.#printAsInlineValue (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:147:25)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:87:64
at Array.map ()
at Dumper.#printObject (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:87:29)
Exit 1
want:
FAIL valid/array/nospaces
Type for key "ints" differs:
Expected: 1 (int64)
Your encoder: map[] (map[string]any)
input sent to parser-cmd:
{
"ints": [
{"type": "integer", "value": "1"},
{"type": "integer", "value": "2"},
{"type": "integer", "value": "3"}
]
}
output from parser-cmd (stdout):
[[ints]]
[[ints]]
[[ints]]
want:
ints = [1,2,3]
FAIL valid/array/open-parent-table
Could not find key "parent-table.not-arr" in encoder output
input sent to parser-cmd:
{
"parent-table": {
"not-arr": {"type": "integer", "value": "1"},
"arr": [
{},
{}
]
}
}
output from parser-cmd (stdout):
[parent-table]
[[parent-table.arr]]
[[parent-table.arr]]
want:
[[parent-table.arr]]
[[parent-table.arr]]
[parent-table]
not-arr = 1
FAIL valid/array/trailing-comma
Type for key "arr-1" differs:
Expected: 1 (int64)
Your encoder: map[] (map[string]any)
input sent to parser-cmd:
{
"arr-1": [{"type": "integer", "value": "1"}],
"arr-3": [{"type": "integer", "value": "4"}],
"arr-2": [
{"type": "integer", "value": "2"},
{"type": "integer", "value": "3"}
],
"arr-4": [
{"type": "integer", "value": "5"},
{"type": "integer", "value": "6"}
]
}
output from parser-cmd (stdout):
[[arr-1]]
[[arr-3]]
[[arr-2]]
[[arr-2]]
[[arr-4]]
[[arr-4]]
want:
arr-1 = [1,]
arr-2 = [2,3,]
arr-3 = [4,
]
arr-4 = [
5,
6,
]
FAIL valid/comment/after-literal-no-ws
decode TOML from encoder:
toml: line 3 (last key "nan"): expected value but found "NaN" instead
input sent to parser-cmd:
{
"false": {"type": "bool", "value": "false"},
"inf": {"type": "float", "value": "inf"},
"nan": {"type": "float", "value": "nan"},
"true": {"type": "bool", "value": "true"}
}
output from parser-cmd (stdout):
false = false
inf = inf
nan = NaN
true = true
want:
inf=inf#infinity
nan=nan#not a number
true=true#true
false=false#false
FAIL valid/comment/everywhere
Could not find key "group.answer" in encoder output
input sent to parser-cmd:
{
"group": {
"answer": {"type": "integer", "value": "42"},
"d": {"type": "date-local", "value": "1979-05-27"},
"dt": {"type": "datetime", "value": "1979-05-27T07:32:12-07:00"},
"more": [
{"type": "integer", "value": "42"},
{"type": "integer", "value": "42"}
]
}
}
output from parser-cmd (stdout):
[group]
d = 1979-05-27T00:00:00.000
dt = 1979-05-27T14:32:12.000
[[group.more]]
[[group.more]]
want:
# Top comment.
# Top comment.
# Top comment.
# [no-extraneous-groups-please]
[group] # Comment
answer = 42 # Comment
# no-extraneous-keys-please = 999
# Inbetween comment.
more = [ # Comment
# What about multiple # comments?
# Can you handle it?
#
# Evil.
# Evil.
42, 42, # Comments within arrays are fun.
# What about multiple # comments?
# Can you handle it?
#
# Evil.
# Evil.
# ] Did I fool you?
] # Hopefully not.
# Make sure the space between the datetime and "#" isn't lexed.
dt = 1979-05-27T07:32:12-07:00 # c
d = 1979-05-27 # Comment
FAIL valid/comment/tricky
Type for key "hash#tag.arr4" differs:
Expected: 1 (int64)
Your encoder: map[] (map[string]any)
input sent to parser-cmd:
{
"hash#tag": {
"#!": {"type": "string", "value": "hash bang"},
"arr5": [[[[[{"type": "string", "value": "#"}]]]]],
"arr3": [
{"type": "string", "value": "#"},
{"type": "string", "value": "#"},
{"type": "string", "value": "###"}
],
"arr4": [
{"type": "integer", "value": "1"},
{"type": "integer", "value": "2"},
{"type": "integer", "value": "3"},
{"type": "integer", "value": "4"}
],
"tbl1": {
"#": {"type": "string", "value": "}#"}
}
},
"section": {
"8": {"type": "string", "value": "eight"},
"eleven": {"type": "float", "value": "11.1"},
"five": {"type": "float", "value": "5.5"},
"four": {"type": "string", "value": "# no comment\n# nor this\n#also not comment"},
"one": {"type": "string", "value": "11"},
"six": {"type": "integer", "value": "6"},
"ten": {"type": "float", "value": "1000.0"},
"three": {"type": "string", "value": "#"},
"two": {"type": "string", "value": "22#"}
}
}
output from parser-cmd (stdout):
["hash#tag"]
"#!" = "hash bang"
arr5 = [[[[["#"]]]]]
arr3 = ["#","#","###"]
[["hash#tag".arr4]]
[["hash#tag".arr4]]
[["hash#tag".arr4]]
[["hash#tag".arr4]]
["hash#tag".tbl1]
"#" = "}#"
[section]
8 = "eight"
eleven = 11.1
five = 5.5
four = "# no comment\n# nor this\n#also not comment"
one = "11"
ten = 1000
three = "#"
two = "22#"
want:
[section]#attached comment
#[notsection]
one = "11"#cmt
two = "22#"
three = '#'
four = """# no comment
# nor this
#also not comment"""#is_comment
five = 5.5#66
six = 6#7
8 = "eight"
#nine = 99
ten = 10e2#1
eleven = 1.11e1#23
["hash#tag"]
"#!" = "hash bang"
arr3 = [ "#", '#', """###""" ]
arr4 = [ 1,# 9, 9,
2#,9
,#9
3#]
,4]
arr5 = [[[[#["#"],
["#"]]]]#]
]
tbl1 = { "#" = '}#'}#}}
FAIL valid/datetime/datetime
Values for key "lower" differ:
Expected: 1987-07-05 17:45:00 +0000 UTC (time.Time)
Your encoder: 1987-07-05 17:45:00 +0100 datetime-local (time.Time)
input sent to parser-cmd:
{
"lower": {"type": "datetime", "value": "1987-07-05T17:45:00Z"},
"space": {"type": "datetime", "value": "1987-07-05T17:45:00Z"}
}
output from parser-cmd (stdout):
lower = 1987-07-05T17:45:00.000
space = 1987-07-05T17:45:00.000
want:
space = 1987-07-05 17:45:00Z
# ABNF is case-insensitive, both "Z" and "z" must be supported.
lower = 1987-07-05t17:45:00z
FAIL valid/datetime/edge
decode TOML from encoder:
toml: line 1 (last key "first-date"): invalid datetime: "1-01-01T00:00:00.000"
input sent to parser-cmd:
{
"first-date": {"type": "date-local", "value": "0001-01-01"},
"first-local": {"type": "datetime-local", "value": "0001-01-01T00:00:00"},
"first-offset": {"type": "datetime", "value": "0001-01-01T00:00:00Z"},
"last-date": {"type": "date-local", "value": "9999-12-31"},
"last-local": {"type": "datetime-local", "value": "9999-12-31T23:59:59"},
"last-offset": {"type": "datetime", "value": "9999-12-31T23:59:59Z"}
}
output from parser-cmd (stdout):
first-date = 1-01-01T00:00:00.000
first-local = 1-01-01T00:25:21.000
first-offset = 1-01-01T00:00:00.000
last-date = 9999-12-31T00:00:00.000
last-local = 9999-12-31T23:59:59.000
last-offset = 9999-12-31T23:59:59.000
want:
first-offset = 0001-01-01 00:00:00Z
first-local = 0001-01-01 00:00:00
first-date = 0001-01-01
last-offset = 9999-12-31 23:59:59Z
last-local = 9999-12-31 23:59:59
last-date = 9999-12-31
FAIL valid/datetime/leap-year
Values for key "2000-datetime" differ:
Expected: 2000-02-29 15:15:15 +0000 UTC (time.Time)
Your encoder: 2000-02-29 15:15:15 +0100 datetime-local (time.Time)
input sent to parser-cmd:
{
"2000-date": {"type": "date-local", "value": "2000-02-29"},
"2000-datetime": {"type": "datetime", "value": "2000-02-29T15:15:15Z"},
"2000-datetime-local": {"type": "datetime-local", "value": "2000-02-29T15:15:15"},
"2024-date": {"type": "date-local", "value": "2024-02-29"},
"2024-datetime": {"type": "datetime", "value": "2024-02-29T15:15:15Z"},
"2024-datetime-local": {"type": "datetime-local", "value": "2024-02-29T15:15:15"}
}
output from parser-cmd (stdout):
2000-date = 2000-02-29T00:00:00.000
2000-datetime = 2000-02-29T15:15:15.000
2000-datetime-local = 2000-02-29T15:15:15.000
2024-date = 2024-02-29T00:00:00.000
2024-datetime = 2024-02-29T15:15:15.000
2024-datetime-local = 2024-02-29T15:15:15.000
want:
2000-datetime = 2000-02-29 15:15:15Z
2000-datetime-local = 2000-02-29 15:15:15
2000-date = 2000-02-29
2024-datetime = 2024-02-29 15:15:15Z
2024-datetime-local = 2024-02-29 15:15:15
2024-date = 2024-02-29
FAIL valid/datetime/local
Values for key "local" differ:
Expected: 1987-07-05 17:45:00 +0100 datetime-local (time.Time)
Your encoder: 1987-07-05 16:45:00 +0100 datetime-local (time.Time)
input sent to parser-cmd:
{
"local": {"type": "datetime-local", "value": "1987-07-05T17:45:00"},
"milli": {"type": "datetime-local", "value": "1977-12-21T10:32:00.555"},
"space": {"type": "datetime-local", "value": "1987-07-05T17:45:00"}
}
output from parser-cmd (stdout):
local = 1987-07-05T16:45:00.000
milli = 1977-12-21T10:32:00.555
space = 1987-07-05T16:45:00.000
want:
local = 1987-07-05T17:45:00
milli = 1977-12-21T10:32:00.555
space = 1987-07-05 17:45:00
FAIL valid/datetime/local-time
decode TOML from encoder:
toml: line 1 (last key "besttimeever"): expected value but found "NaN" instead
input sent to parser-cmd:
{
"besttimeever": {"type": "time-local", "value": "17:45:00"},
"milliseconds": {"type": "time-local", "value": "10:32:00.555"}
}
output from parser-cmd (stdout):
besttimeever = NaN-NaN-NaNTNaN:NaN:NaN.NaN
milliseconds = NaN-NaN-NaNTNaN:NaN:NaN.NaN
want:
besttimeever = 17:45:00
milliseconds = 10:32:00.555
FAIL valid/datetime/milliseconds
Values for key "utc1" differ:
Expected: 1987-07-05 17:45:56.123 +0000 UTC (time.Time)
Your encoder: 1987-07-05 17:45:56.123 +0100 datetime-local (time.Time)
input sent to parser-cmd:
{
"utc1": {"type": "datetime", "value": "1987-07-05T17:45:56.123Z"},
"utc2": {"type": "datetime", "value": "1987-07-05T17:45:56.600Z"},
"wita1": {"type": "datetime", "value": "1987-07-05T17:45:56.123+08:00"},
"wita2": {"type": "datetime", "value": "1987-07-05T17:45:56.600+08:00"}
}
output from parser-cmd (stdout):
utc1 = 1987-07-05T17:45:56.123
utc2 = 1987-07-05T17:45:56.600
wita1 = 1987-07-05T09:45:56.123
wita2 = 1987-07-05T09:45:56.600
want:
utc1 = 1987-07-05T17:45:56.123Z
utc2 = 1987-07-05T17:45:56.6Z
wita1 = 1987-07-05T17:45:56.123+08:00
wita2 = 1987-07-05T17:45:56.6+08:00
FAIL valid/datetime/timezone
Values for key "nzdt" differ:
Expected: 1987-07-05 17:45:56 +1300 +1300 (time.Time)
Your encoder: 1987-07-05 04:45:56 +0100 datetime-local (time.Time)
input sent to parser-cmd:
{
"nzdt": {"type": "datetime", "value": "1987-07-05T17:45:56+13:00"},
"nzst": {"type": "datetime", "value": "1987-07-05T17:45:56+12:00"},
"pdt": {"type": "datetime", "value": "1987-07-05T17:45:56-05:00"},
"utc": {"type": "datetime", "value": "1987-07-05T17:45:56Z"}
}
output from parser-cmd (stdout):
nzdt = 1987-07-05T04:45:56.000
nzst = 1987-07-05T05:45:56.000
pdt = 1987-07-05T22:45:56.000
utc = 1987-07-05T17:45:56.000
want:
utc = 1987-07-05T17:45:56Z
pdt = 1987-07-05T17:45:56-05:00
nzst = 1987-07-05T17:45:56+12:00
nzdt = 1987-07-05T17:45:56+13:00 # DST
FAIL valid/example
Values for key "best-day-ever" differ:
Expected: 1987-07-05 17:45:00 +0000 UTC (time.Time)
Your encoder: 1987-07-05 17:45:00 +0100 datetime-local (time.Time)
input sent to parser-cmd:
{
"best-day-ever": {"type": "datetime", "value": "1987-07-05T17:45:00Z"},
"numtheory": {
"boring": {"type": "bool", "value": "false"},
"perfection": [
{"type": "integer", "value": "6"},
{"type": "integer", "value": "28"},
{"type": "integer", "value": "496"}
]
}
}
output from parser-cmd (stdout):
best-day-ever = 1987-07-05T17:45:00.000
[numtheory]
boring = false
[[numtheory.perfection]]
[[numtheory.perfection]]
[[numtheory.perfection]]
want:
best-day-ever = 1987-07-05T17:45:00Z
[numtheory]
boring = false
perfection = [6, 28, 496]
FAIL valid/float/inf-and-nan
decode TOML from encoder:
toml: line 4 (last key "nan"): expected value but found "NaN" instead
input sent to parser-cmd:
{
"infinity": {"type": "float", "value": "inf"},
"infinity_neg": {"type": "float", "value": "-inf"},
"infinity_plus": {"type": "float", "value": "inf"},
"nan": {"type": "float", "value": "nan"},
"nan_neg": {"type": "float", "value": "nan"},
"nan_plus": {"type": "float", "value": "nan"}
}
output from parser-cmd (stdout):
infinity = inf
infinity_neg = -inf
infinity_plus = inf
nan = NaN
nan_neg = NaN
nan_plus = NaN
want:
# We don't encode +nan and -nan back with the signs; many languages don't
# support a sign on NaN (it doesn't really make much sense).
nan = nan
nan_neg = -nan
nan_plus = +nan
infinity = inf
infinity_neg = -inf
infinity_plus = +inf
FAIL valid/implicit-and-explicit-after
Could not find key "a.better" in encoder output
input sent to parser-cmd:
{
"a": {
"better": {"type": "integer", "value": "43"},
"b": {
"c": {
"answer": {"type": "integer", "value": "42"}
}
}
}
}
output from parser-cmd (stdout):
[a.b.c]
want:
[a.b.c]
answer = 42
[a]
better = 43
FAIL valid/implicit-and-explicit-before
Could not find key "a.better" in encoder output
input sent to parser-cmd:
{
"a": {
"better": {"type": "integer", "value": "43"},
"b": {
"c": {
"answer": {"type": "integer", "value": "42"}
}
}
}
}
output from parser-cmd (stdout):
[a.b.c]
want:
[a]
better = 43
[a.b.c]
answer = 42
FAIL valid/implicit-groups
Could not find key "a.b.c.answer" in encoder output
input sent to parser-cmd:
{
"a": {
"b": {
"c": {
"answer": {"type": "integer", "value": "42"}
}
}
}
}
output from parser-cmd (stdout):
[a.b.c]
want:
[a.b.c]
answer = 42
FAIL valid/inline-table/array
Could not find key "arr.a" in encoder output
input sent to parser-cmd:
{
"arr": [
{
"a": {"type": "integer", "value": "1"}
},
{
"a": {"type": "integer", "value": "2"}
}
],
"people": [
{
"first_name": {"type": "string", "value": "Bruce"},
"last_name": {"type": "string", "value": "Springsteen"}
},
{
"first_name": {"type": "string", "value": "Eric"},
"last_name": {"type": "string", "value": "Clapton"}
},
{
"first_name": {"type": "string", "value": "Bob"},
"last_name": {"type": "string", "value": "Seger"}
}
]
}
output from parser-cmd (stdout):
[[arr]]
[[arr]]
[[people]]
first_name = "Bruce"
last_name = "Springsteen"
[[people]]
first_name = "Eric"
last_name = "Clapton"
[[people]]
first_name = "Bob"
last_name = "Seger"
want:
arr = [ {'a'= 1}, {'a'= 2} ]
people = [{first_name = "Bruce", last_name = "Springsteen"},
{first_name = "Eric", last_name = "Clapton"},
{first_name = "Bob", last_name = "Seger"}]
FAIL valid/inline-table/array-values
Type for key "b.a" differs:
Expected: 1 (int64)
Your encoder: map[] (map[string]any)
input sent to parser-cmd:
{
"a": {"a": []},
"b": {
"a": [
{"type": "integer", "value": "1"},
{"type": "integer", "value": "2"}
],
"b": [
{"type": "integer", "value": "3"},
{"type": "integer", "value": "4"}
]
}
}
output from parser-cmd (stdout):
[a]
a = []
[b]
[[b.a]]
[[b.a]]
[[b.b]]
[[b.b]]
want:
# "No newlines are allowed between the curly braces unless they are valid within
# a value"
a = { a = [
]}
b = { a = [
1,
2,
], b = [
3,
4,
]}
FAIL valid/inline-table/empty
Could not find key "empty_in_array.not_empty" in encoder output
input sent to parser-cmd:
{
"empty1": {},
"empty2": {},
"with_cmt": {},
"empty_in_array": [
{
"not_empty": {"type": "integer", "value": "1"}
},
{}
],
"empty_in_array2": [
{},
{
"not_empty": {"type": "integer", "value": "1"}
}
],
"many_empty": [
{},
{},
{}
],
"nested_empty": {
"empty": {}
}
}
output from parser-cmd (stdout):
[empty1]
[empty2]
[with_cmt]
[[empty_in_array]]
[[empty_in_array]]
[[empty_in_array2]]
[[empty_in_array2]]
[[many_empty]]
[[many_empty]]
[[many_empty]]
[nested_empty.empty]
want:
empty1 = {}
empty2 = { }
empty_in_array = [ { not_empty = 1 }, {} ]
empty_in_array2 = [{},{not_empty=1}]
many_empty = [{},{},{}]
nested_empty = {"empty"={}}
with_cmt ={ }#nothing here
FAIL valid/inline-table/inline-table
Could not find key "point.x" in encoder output
input sent to parser-cmd:
{
"name": {
"first": {"type": "string", "value": "Tom"},
"last": {"type": "string", "value": "Preston-Werner"}
},
"point": {
"x": {"type": "integer", "value": "1"},
"y": {"type": "integer", "value": "2"}
},
"simple": {
"a": {"type": "integer", "value": "1"}
},
"str-key": {
"a": {"type": "integer", "value": "1"}
},
"table-array": [
{
"a": {"type": "integer", "value": "1"}
},
{
"b": {"type": "integer", "value": "2"}
}
]
}
output from parser-cmd (stdout):
[name]
first = "Tom"
last = "Preston-Werner"
[point]
[simple]
[str-key]
[[table-array]]
[[table-array]]
want:
name = { first = "Tom", last = "Preston-Werner" }
point = { x = 1, y = 2 }
simple = { a = 1 }
str-key = { "a" = 1 }
table-array = [{ "a" = 1 }, { "b" = 2 }]
FAIL valid/inline-table/key-dotted-1
Could not find key "a.a.b" in encoder output
input sent to parser-cmd:
{
"a": {
"a": {
"b": {"type": "integer", "value": "1"}
}
},
"b": {
"a": {
"b": {"type": "integer", "value": "1"}
}
},
"c": {
"a": {
"b": {"type": "integer", "value": "1"}
}
},
"d": {
"a": {
"b": {"type": "integer", "value": "1"}
}
},
"e": {
"a": {
"b": {"type": "integer", "value": "1"}
}
}
}
output from parser-cmd (stdout):
[a.a]
[b.a]
[c.a]
[d.a]
[e.a]
want:
a = { a.b = 1 }
b = { "a"."b" = 1 }
c = { a . b = 1 }
d = { 'a' . "b" = 1 }
e = {a.b=1}
FAIL valid/inline-table/key-dotted-2
Could not find key "many.dots.here.dot.dot.dot.a.b.c" in encoder output
input sent to parser-cmd:
{
"many": {
"dots": {
"here": {
"dot": {
"dot": {
"dot": {
"a": {
"b": {
"c": {"type": "integer", "value": "1"},
"d": {"type": "integer", "value": "2"}
}
}
}
}
}
}
}
}
}
output from parser-cmd (stdout):
[many.dots.here.dot.dot.dot.a.b]
want:
many.dots.here.dot.dot.dot = {a.b.c = 1, a.b.d = 2}
FAIL valid/inline-table/key-dotted-3
Could not find key "tbl.a.b.c.d.e" in encoder output
input sent to parser-cmd:
{
"tbl": {
"a": {
"b": {
"c": {
"d": {
"e": {"type": "integer", "value": "1"}
}
}
}
},
"x": {
"a": {
"b": {
"c": {
"d": {
"e": {"type": "integer", "value": "1"}
}
}
}
}
}
}
}
output from parser-cmd (stdout):
[tbl.a.b.c.d]
[tbl.x.a.b.c.d]
want:
[tbl]
a.b.c = {d.e=1}
[tbl.x]
a.b.c = {d.e=1}
FAIL valid/inline-table/key-dotted-4
Could not find key "arr.T.a.b" in encoder output
input sent to parser-cmd:
{
"arr": [
{
"T": {
"a": {
"b": {"type": "integer", "value": "1"}
}
},
"t": {
"a": {
"b": {"type": "integer", "value": "1"}
}
}
},
{
"T": {
"a": {
"b": {"type": "integer", "value": "2"}
}
},
"t": {
"a": {
"b": {"type": "integer", "value": "2"}
}
}
}
]
}
output from parser-cmd (stdout):
[[arr]]
[arr.T.a]
[arr.t.a]
[[arr]]
[arr.T.a]
[arr.t.a]
want:
[[arr]]
t = {a.b=1}
T = {a.b=1}
[[arr]]
t = {a.b=2}
T = {a.b=2}
FAIL valid/inline-table/key-dotted-5
error: Uncaught (in promise) Error: should never reach
throw new Error("should never reach");
^
at Dumper.#printAsInlineValue (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:161:11)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:156:35
at Array.map ()
at Dumper.#printAsInlineValue (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:153:38)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:156:35
at Array.map ()
at Dumper.#printAsInlineValue (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:153:38)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:87:64
at Array.map ()
at Dumper.#printObject (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:87:29)
Exit 1
input sent to parser-cmd:
{
"arr-1": [{
"a": {
"b": {"type": "integer", "value": "1"}
}
}],
"arr-2": [
{"type": "string", "value": "str"},
{
"a": {
"b": {"type": "integer", "value": "1"}
}
}
],
"arr-3": [
{
"a": {
"b": {"type": "integer", "value": "1"}
}
},
{
"a": {
"b": {"type": "integer", "value": "2"}
}
}
],
"arr-4": [
{"type": "string", "value": "str"},
{
"a": {
"b": {"type": "integer", "value": "1"}
}
},
{
"a": {
"b": {"type": "integer", "value": "2"}
}
}
]
}
output from parser-cmd (stderr):
error: Uncaught (in promise) Error: should never reach
throw new Error("should never reach");
^
at Dumper.#printAsInlineValue (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:161:11)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:156:35
at Array.map ()
at Dumper.#printAsInlineValue (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:153:38)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:156:35
at Array.map ()
at Dumper.#printAsInlineValue (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:153:38)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:87:64
at Array.map ()
at Dumper.#printObject (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:87:29)
Exit 1
want:
FAIL valid/inline-table/key-dotted-6
Could not find key "top.dot.dot.dot.dot.dot" in encoder output
input sent to parser-cmd:
{
"top": {
"dot": {
"dot": [
{
"dot": {
"dot": {
"dot": {"type": "integer", "value": "1"}
}
}
},
{
"dot": {
"dot": {
"dot": {"type": "integer", "value": "2"}
}
}
}
]
}
}
}
output from parser-cmd (stdout):
[top.dot]
[[top.dot.dot]]
[top.dot.dot.dot.dot]
[[top.dot.dot]]
[top.dot.dot.dot.dot]
want:
top.dot.dot = [
{dot.dot.dot = 1},
{dot.dot.dot = 2},
]
FAIL valid/inline-table/key-dotted-7
Could not find key "arr.a.b.c.d" in encoder output
input sent to parser-cmd:
{
"arr": [{
"a": {"b": [{
"c": {
"d": {"type": "integer", "value": "1"}
}
}]}
}]
}
output from parser-cmd (stdout):
[[arr]]
[arr.a]
[[arr.a.b]]
[arr.a.b.c]
want:
arr = [
{a.b = [{c.d = 1}]}
]
FAIL valid/inline-table/multiline
Could not find key "tbl_multiline.a" in encoder output
input sent to parser-cmd:
{
"tbl_multiline": {
"a": {"type": "integer", "value": "1"},
"b": {"type": "string", "value": "multiline\n"},
"c": {"type": "string", "value": "and yet\nanother line"},
"d": {"type": "integer", "value": "4"}
}
}
output from parser-cmd (stdout):
[tbl_multiline]
b = "multiline\n"
c = "and yet\nanother line"
want:
tbl_multiline = { a = 1, b = """
multiline
""", c = """and yet
another line""", d = 4 }
FAIL valid/inline-table/nest
error: Uncaught (in promise) Error: should never reach
throw new Error("should never reach");
^
at Dumper.#printAsInlineValue (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:161:11)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:156:35
at Array.map ()
at Dumper.#printAsInlineValue (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:153:38)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:147:60
at Array.map ()
at Dumper.#printAsInlineValue (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:147:25)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:87:64
at Array.map ()
at Dumper.#printObject (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:87:29)
Exit 1
input sent to parser-cmd:
{
"arr_arr_tbl_empty": [[{}]],
"arr_arr_tbl_val": [[{
"one": {"type": "integer", "value": "1"}
}]],
"arr_arr_tbls": [[
{
"one": {"type": "integer", "value": "1"}
},
{
"two": {"type": "integer", "value": "2"}
}
]],
"arr_tbl_tbl": [{
"tbl": {
"one": {"type": "integer", "value": "1"}
}
}],
"tbl_arr_tbl": {"arr_tbl": [{
"one": {"type": "integer", "value": "1"}
}]},
"tbl_tbl_empty": {
"tbl_0": {}
},
"tbl_tbl_val": {
"tbl_1": {
"one": {"type": "integer", "value": "1"}
}
}
}
output from parser-cmd (stderr):
error: Uncaught (in promise) Error: should never reach
throw new Error("should never reach");
^
at Dumper.#printAsInlineValue (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:161:11)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:156:35
at Array.map ()
at Dumper.#printAsInlineValue (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:153:38)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:147:60
at Array.map ()
at Dumper.#printAsInlineValue (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:147:25)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:87:64
at Array.map ()
at Dumper.#printObject (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:87:29)
Exit 1
want:
FAIL valid/integer/float64-max
Could not find key "max_int" in encoder output
input sent to parser-cmd:
{
"max_int": {"type": "integer", "value": "9007199254740991"},
"min_int": {"type": "integer", "value": "-9007199254740991"}
}
output from parser-cmd (stdout):
want:
# Maximum and minimum safe float64 natural numbers. Mainly here for
# -int-as-float.
max_int = 9_007_199_254_740_991
min_int = -9_007_199_254_740_991
FAIL valid/integer/integer
Could not find key "answer" in encoder output
input sent to parser-cmd:
{
"answer": {"type": "integer", "value": "42"},
"neganswer": {"type": "integer", "value": "-42"},
"posanswer": {"type": "integer", "value": "42"},
"zero": {"type": "integer", "value": "0"}
}
output from parser-cmd (stdout):
want:
answer = 42
posanswer = +42
neganswer = -42
zero = 0
FAIL valid/integer/literals
Could not find key "bin1" in encoder output
input sent to parser-cmd:
{
"bin1": {"type": "integer", "value": "214"},
"bin2": {"type": "integer", "value": "5"},
"hex1": {"type": "integer", "value": "3735928559"},
"hex2": {"type": "integer", "value": "3735928559"},
"hex3": {"type": "integer", "value": "3735928559"},
"hex4": {"type": "integer", "value": "2439"},
"oct1": {"type": "integer", "value": "342391"},
"oct2": {"type": "integer", "value": "493"},
"oct3": {"type": "integer", "value": "501"}
}
output from parser-cmd (stdout):
want:
bin1 = 0b11010110
bin2 = 0b1_0_1
oct1 = 0o01234567
oct2 = 0o755
oct3 = 0o7_6_5
hex1 = 0xDEADBEEF
hex2 = 0xdeadbeef
hex3 = 0xdead_beef
hex4 = 0x00987
FAIL valid/integer/underscore
Could not find key "kilo" in encoder output
input sent to parser-cmd:
{
"kilo": {"type": "integer", "value": "1000"},
"x": {"type": "integer", "value": "1111"}
}
output from parser-cmd (stdout):
want:
kilo = 1_000
x = 1_1_1_1
FAIL valid/integer/zero
Could not find key "a2" in encoder output
input sent to parser-cmd:
{
"a2": {"type": "integer", "value": "0"},
"a3": {"type": "integer", "value": "0"},
"b1": {"type": "integer", "value": "0"},
"b2": {"type": "integer", "value": "0"},
"b3": {"type": "integer", "value": "0"},
"d1": {"type": "integer", "value": "0"},
"d2": {"type": "integer", "value": "0"},
"d3": {"type": "integer", "value": "0"},
"h1": {"type": "integer", "value": "0"},
"h2": {"type": "integer", "value": "0"},
"h3": {"type": "integer", "value": "0"},
"o1": {"type": "integer", "value": "0"}
}
output from parser-cmd (stdout):
want:
d1 = 0
d2 = +0
d3 = -0
h1 = 0x0
h2 = 0x00
h3 = 0x00000
o1 = 0o0
a2 = 0o00
a3 = 0o00000
b1 = 0b0
b2 = 0b00
b3 = 0b00000
FAIL valid/key/alphanum
Could not find key "34-11" in encoder output
input sent to parser-cmd:
{
"000111": {"type": "string", "value": "leading"},
"10e3": {"type": "string", "value": "false float"},
"123": {"type": "string", "value": "num"},
"34-11": {"type": "integer", "value": "23"},
"alpha": {"type": "string", "value": "a"},
"one1two2": {"type": "string", "value": "mixed"},
"under_score": {"type": "string", "value": "___"},
"with-dash": {"type": "string", "value": "dashed"},
"2018_10": {
"001": {"type": "integer", "value": "1"}
},
"a-a-a": {
"_": {"type": "bool", "value": "false"}
}
}
output from parser-cmd (stdout):
123 = "num"
000111 = "leading"
10e3 = "false float"
alpha = "a"
one1two2 = "mixed"
under_score = "___"
with-dash = "dashed"
[2018_10]
[a-a-a]
_ = false
want:
alpha = "a"
123 = "num"
000111 = "leading"
10e3 = "false float"
one1two2 = "mixed"
with-dash = "dashed"
under_score = "___"
34-11 = 23
[2018_10]
001 = 1
[a-a-a]
_ = false
FAIL valid/key/dotted-1
Could not find key "many.dots.dot.dot.dot" in encoder output
input sent to parser-cmd:
{
"many": {
"dots": {
"dot": {
"dot": {
"dot": {"type": "integer", "value": "42"}
}
}
}
},
"name": {
"first": {"type": "string", "value": "Arthur"},
"last": {"type": "string", "value": "Dent"}
}
}
output from parser-cmd (stdout):
[many.dots.dot.dot]
[name]
first = "Arthur"
last = "Dent"
want:
name.first = "Arthur"
"name".'last' = "Dent"
many.dots.dot.dot.dot = 42
FAIL valid/key/dotted-2
Could not find key "count.a" in encoder output
input sent to parser-cmd:
{
"count": {
"a": {"type": "integer", "value": "1"},
"b": {"type": "integer", "value": "2"},
"c": {"type": "integer", "value": "3"},
"d": {"type": "integer", "value": "4"},
"e": {"type": "integer", "value": "5"},
"f": {"type": "integer", "value": "6"},
"g": {"type": "integer", "value": "7"},
"h": {"type": "integer", "value": "8"},
"i": {"type": "integer", "value": "9"},
"j": {"type": "integer", "value": "10"},
"k": {"type": "integer", "value": "11"},
"l": {"type": "integer", "value": "12"}
}
}
output from parser-cmd (stdout):
[count]
want:
# Note: this file contains literal tab characters.
# Space are ignored, and key parts can be quoted.
count.a = 1
count . b = 2
"count"."c" = 3
"count" . "d" = 4
'count'.'e' = 5
'count' . 'f' = 6
"count".'g' = 7
"count" . 'h' = 8
count.'i' = 9
count . 'j' = 10
"count".k = 11
"count" . l = 12
FAIL valid/key/dotted-3
Could not find key "top.key" in encoder output
input sent to parser-cmd:
{
"a": {
"few": {
"dots": {
"polka": {
"dance-with": {"type": "string", "value": "Dot"},
"dot": {"type": "string", "value": "again?"}
}
}
}
},
"tbl": {
"a": {
"b": {
"c": {"type": "float", "value": "42.666"}
}
}
},
"top": {
"key": {"type": "integer", "value": "1"}
}
}
output from parser-cmd (stdout):
[a.few.dots.polka]
dance-with = "Dot"
dot = "again?"
[tbl.a.b]
c = 42.666
[top]
want:
top.key = 1
[tbl]
a.b.c = 42.666
[a.few.dots]
polka.dot = "again?"
polka.dance-with = "Dot"
FAIL valid/key/dotted-4
Could not find key "arr.a.b.c" in encoder output
input sent to parser-cmd:
{
"arr": [
{
"a": {
"b": {
"c": {"type": "integer", "value": "1"},
"d": {"type": "integer", "value": "2"}
}
}
},
{
"a": {
"b": {
"c": {"type": "integer", "value": "3"},
"d": {"type": "integer", "value": "4"}
}
}
}
],
"top": {
"key": {"type": "integer", "value": "1"}
}
}
output from parser-cmd (stdout):
[[arr]]
[arr.a.b]
[[arr]]
[arr.a.b]
[top]
want:
top.key = 1
[[arr]]
a.b.c=1
a.b.d=2
[[arr]]
a.b.c=3
a.b.d=4
FAIL valid/key/empty-3
Could not find key "" in encoder output
input sent to parser-cmd:
{
"": {"type": "integer", "value": "0"}
}
output from parser-cmd (stdout):
want:
''=0
FAIL valid/key/equals-nospace
Could not find key "answer" in encoder output
input sent to parser-cmd:
{
"answer": {"type": "integer", "value": "42"}
}
output from parser-cmd (stdout):
want:
answer=42
FAIL valid/key/like-date
Could not find key "15:16:17" in encoder output
input sent to parser-cmd:
{
"15:16:17": {"type": "integer", "value": "6"},
"2001-02-03": {"type": "integer", "value": "1"},
"2001-02-04": {"type": "integer", "value": "2"},
"2001-02-05": {"type": "integer", "value": "3"},
"2001-02-06T15:16:17+01:00": {"type": "integer", "value": "4"},
"2001-02-07T15:16:17": {"type": "integer", "value": "5"},
"2002-01-04": [{
"k": {"type": "integer", "value": "12"}
}],
"2001-02-11": {
"a": {
"2001-02-12": {"type": "integer", "value": "9"}
}
},
"2002-01-02": {
"k": {"type": "integer", "value": "10"},
"2024-01-03": {
"k": {"type": "integer", "value": "11"}
}
},
"a": {
"2001-02-08": {"type": "integer", "value": "7"},
"2001-02-09": {
"2001-02-10": {"type": "integer", "value": "8"}
}
}
}
output from parser-cmd (stdout):
[[2002-01-04]]
[2001-02-11.a]
[2002-01-02.2024-01-03]
[a.2001-02-09]
want:
# '-' is a valid character in keys: make a key that looks like a date.
2001-02-03 = 1
"2001-02-04" = 2
'2001-02-05' = 3
# Also include datetime and time for good measure; these need to be quoted as
# ':' isn't a valid bare key.
"2001-02-06T15:16:17+01:00" = 4
"2001-02-07T15:16:17" = 5
"15:16:17" = 6
# Dotted keys
a.2001-02-08 = 7
a.2001-02-09.2001-02-10 = 8
2001-02-11.a.2001-02-12 = 9
# Table names
[2002-01-02]
k = 10
[2002-01-02.2024-01-03]
k = 11
[[2002-01-04]]
k = 12
FAIL valid/key/quoted-dots
Could not find key "plain" in encoder output
input sent to parser-cmd:
{
"plain": {"type": "integer", "value": "1"},
"with.dot": {"type": "integer", "value": "2"},
"plain_table": {
"plain": {"type": "integer", "value": "3"},
"with.dot": {"type": "integer", "value": "4"}
},
"table": {
"withdot": {
"key.with.dots": {"type": "integer", "value": "6"},
"plain": {"type": "integer", "value": "5"}
}
}
}
output from parser-cmd (stdout):
[plain_table]
[table.withdot]
want:
plain = 1
"with.dot" = 2
[plain_table]
plain = 3
"with.dot" = 4
[table.withdot]
plain = 5
"key.with.dots" = 6
FAIL valid/key/quoted-unicode
decode TOML from encoder:
toml: line 2: TOML files cannot contain control characters: '0x7f'
input sent to parser-cmd:
{
"\u0000": {"type": "string", "value": "null"},
"\b \f A € ÿ ퟿  ï¿¿ ð€€ ô¿¿": {"type": "string", "value": "escaped key"},
"\\u0000": {"type": "string", "value": "different key"},
"l ~ € ÿ ퟿  ï¿¿ ð€€ ô¿¿": {"type": "string", "value": "literal key"},
"~ € ÿ ퟿  ï¿¿ ð€€ ô¿¿": {"type": "string", "value": "basic key"}
}
output from parser-cmd (stdout):
"\u0000" = "null"
"\b \f A € ÿ ퟿  ï¿¿ ð€€ ô¿¿" = "escaped key"
"\\u0000" = "different key"
"l ~ € ÿ ퟿  ï¿¿ ð€€ ô¿¿" = "literal key"
"~ € ÿ ퟿  ï¿¿ ð€€ ô¿¿" = "basic key"
want:
"\u0000" = "null"
'\u0000' = "different key"
"\u0008 \u000c \U00000041 \u007f \u0080 \u00ff \ud7ff \ue000 \uffff \U00010000 \U0010ffff" = "escaped key"
"~ € ÿ ퟿  ï¿¿ ð€€ ô¿¿" = "basic key"
'l ~ € ÿ ퟿  ï¿¿ ð€€ ô¿¿' = "literal key"
FAIL valid/key/space
Could not find key " c d " in encoder output
input sent to parser-cmd:
{
" c d ": {"type": "integer", "value": "2"},
"a b": {"type": "integer", "value": "1"},
" tbl ": {
"\ttab\ttab\t": {"type": "string", "value": "tab"}
}
}
output from parser-cmd (stdout):
[" tbl "]
"\ttab\ttab\t" = "tab"
want:
# Keep whitespace inside quotes keys at all positions.
"a b" = 1
" c d " = 2
[ " tbl " ]
"\ttab\ttab\t" = "tab"
FAIL valid/key/special-chars
Could not find key "=~!@$^&*()_+-`1234567890[]|/?><.,;:'=" in encoder output
input sent to parser-cmd:
{
"=~!@$^\u0026*()_+-`1234567890[]|/?\u003e\u003c.,;:'=": {"type": "integer", "value": "1"}
}
output from parser-cmd (stdout):
want:
"=~!@$^&*()_+-`1234567890[]|/?><.,;:'=" = 1
FAIL valid/key/special-word
Could not find key "inf" in encoder output
input sent to parser-cmd:
{
"false": {"type": "bool", "value": "false"},
"inf": {"type": "integer", "value": "100000000"},
"nan": {"type": "string", "value": "ceci n'est pas un nombre"},
"true": {"type": "integer", "value": "1"}
}
output from parser-cmd (stdout):
false = false
nan = "ceci n'est pas un nombre"
want:
false = false
true = 1
inf = 100000000
nan = "ceci n'est pas un nombre"
FAIL valid/key/start
Could not find key "-.-" in encoder output
input sent to parser-cmd:
{
"-": {
"-": {"type": "integer", "value": "4"}
},
"---": {
"---": {"type": "integer", "value": "7"}
},
"-key": {
"-key": {"type": "integer", "value": "1"}
},
"1": {
"1": {"type": "integer", "value": "6"}
},
"111": {
"111": {"type": "integer", "value": "9"}
},
"1key": {
"1key": {"type": "integer", "value": "3"}
},
"_": {
"_": {"type": "integer", "value": "5"}
},
"___": {
"___": {"type": "integer", "value": "8"}
},
"_key": {
"_key": {"type": "integer", "value": "2"}
},
"inline": {
"---": {
"---": {"type": "integer", "value": "10"},
"111": {"type": "integer", "value": "12"},
"___": {"type": "integer", "value": "11"}
}
}
}
output from parser-cmd (stdout):
[1]
[111]
[-]
[---]
[-key]
[1key]
[_]
[___]
[_key]
[inline.---]
want:
# Table and keys can start with any character; there is no requirement for it to
# start with a letter.
[-key]
-key = 1
[_key]
_key = 2
[1key]
1key = 3
[-]
- = 4
[_]
_ = 5
[1]
1 = 6
[---]
--- = 7
[___]
___ = 8
[111]
111 = 9
[inline]
--- = {--- = 10, ___ = 11, 111 = 12}
FAIL valid/key/zero
Could not find key "0" in encoder output
input sent to parser-cmd:
{
"0": {"type": "integer", "value": "0"}
}
output from parser-cmd (stdout):
want:
0=0
FAIL valid/spec-example-1
error: Uncaught (in promise) Error: should never reach
throw new Error("should never reach");
^
at Dumper.#printAsInlineValue (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:161:11)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:147:60
at Array.map ()
at Dumper.#printAsInlineValue (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:147:25)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:87:64
at Array.map ()
at Dumper.#printObject (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:87:29)
at Dumper.#printObject (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:95:40)
at Dumper.dump (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:45:36)
at stringify (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:291:26)
Exit 1
input sent to parser-cmd:
{
"title": {"type": "string", "value": "TOML Example"},
"clients": {
"data": [
[
{"type": "string", "value": "gamma"},
{"type": "string", "value": "delta"}
],
[
{"type": "integer", "value": "1"},
{"type": "integer", "value": "2"}
]
],
"hosts": [
{"type": "string", "value": "alpha"},
{"type": "string", "value": "omega"}
]
},
"database": {
"connection_max": {"type": "integer", "value": "5000"},
"enabled": {"type": "bool", "value": "true"},
"server": {"type": "string", "value": "192.168.1.1"},
"ports": [
{"type": "integer", "value": "8001"},
{"type": "integer", "value": "8001"},
{"type": "integer", "value": "8002"}
]
},
"owner": {
"dob": {"type": "datetime", "value": "1979-05-27T07:32:00-08:00"},
"name": {"type": "string", "value": "Lance Uppercut"}
},
"servers": {
"alpha": {
"dc": {"type": "string", "value": "eqdc10"},
"ip": {"type": "string", "value": "10.0.0.1"}
},
"beta": {
"dc": {"type": "string", "value": "eqdc10"},
"ip": {"type": "string", "value": "10.0.0.2"}
}
}
}
output from parser-cmd (stderr):
error: Uncaught (in promise) Error: should never reach
throw new Error("should never reach");
^
at Dumper.#printAsInlineValue (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:161:11)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:147:60
at Array.map ()
at Dumper.#printAsInlineValue (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:147:25)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:87:64
at Array.map ()
at Dumper.#printObject (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:87:29)
at Dumper.#printObject (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:95:40)
at Dumper.dump (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:45:36)
at stringify (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:291:26)
Exit 1
want:
FAIL valid/spec-example-1-compact
error: Uncaught (in promise) Error: should never reach
throw new Error("should never reach");
^
at Dumper.#printAsInlineValue (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:161:11)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:147:60
at Array.map ()
at Dumper.#printAsInlineValue (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:147:25)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:87:64
at Array.map ()
at Dumper.#printObject (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:87:29)
at Dumper.#printObject (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:95:40)
at Dumper.dump (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:45:36)
at stringify (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:291:26)
Exit 1
input sent to parser-cmd:
{
"title": {"type": "string", "value": "TOML Example"},
"clients": {
"data": [
[
{"type": "string", "value": "gamma"},
{"type": "string", "value": "delta"}
],
[
{"type": "integer", "value": "1"},
{"type": "integer", "value": "2"}
]
],
"hosts": [
{"type": "string", "value": "alpha"},
{"type": "string", "value": "omega"}
]
},
"database": {
"connection_max": {"type": "integer", "value": "5000"},
"enabled": {"type": "bool", "value": "true"},
"server": {"type": "string", "value": "192.168.1.1"},
"ports": [
{"type": "integer", "value": "8001"},
{"type": "integer", "value": "8001"},
{"type": "integer", "value": "8002"}
]
},
"owner": {
"dob": {"type": "datetime", "value": "1979-05-27T07:32:00-08:00"},
"name": {"type": "string", "value": "Lance Uppercut"}
},
"servers": {
"alpha": {
"dc": {"type": "string", "value": "eqdc10"},
"ip": {"type": "string", "value": "10.0.0.1"}
},
"beta": {
"dc": {"type": "string", "value": "eqdc10"},
"ip": {"type": "string", "value": "10.0.0.2"}
}
}
}
output from parser-cmd (stderr):
error: Uncaught (in promise) Error: should never reach
throw new Error("should never reach");
^
at Dumper.#printAsInlineValue (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:161:11)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:147:60
at Array.map ()
at Dumper.#printAsInlineValue (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:147:25)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:87:64
at Array.map ()
at Dumper.#printObject (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:87:29)
at Dumper.#printObject (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:95:40)
at Dumper.dump (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:45:36)
at stringify (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:291:26)
Exit 1
want:
FAIL valid/spec/array-0
error: Uncaught (in promise) Error: should never reach
throw new Error("should never reach");
^
at Dumper.#printAsInlineValue (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:161:11)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:147:60
at Array.map ()
at Dumper.#printAsInlineValue (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:147:25)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:87:64
at Array.map ()
at Dumper.#printObject (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:87:29)
at Dumper.dump (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:45:36)
at stringify (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:291:26)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/deno-toml-encoder.ts:39:22
Exit 1
input sent to parser-cmd:
{
"colors": [
{"type": "string", "value": "red"},
{"type": "string", "value": "yellow"},
{"type": "string", "value": "green"}
],
"contributors": [
{"type": "string", "value": "Foo Bar \u003cfoo@example.com\u003e"},
{
"email": {"type": "string", "value": "bazqux@example.com"},
"name": {"type": "string", "value": "Baz Qux"},
"url": {"type": "string", "value": "https://example.com/bazqux"}
}
],
"integers": [
{"type": "integer", "value": "1"},
{"type": "integer", "value": "2"},
{"type": "integer", "value": "3"}
],
"nested_arrays_of_ints": [
[
{"type": "integer", "value": "1"},
{"type": "integer", "value": "2"}
],
[
{"type": "integer", "value": "3"},
{"type": "integer", "value": "4"},
{"type": "integer", "value": "5"}
]
],
"nested_mixed_array": [
[
{"type": "integer", "value": "1"},
{"type": "integer", "value": "2"}
],
[
{"type": "string", "value": "a"},
{"type": "string", "value": "b"},
{"type": "string", "value": "c"}
]
],
"numbers": [
{"type": "float", "value": "0.1"},
{"type": "float", "value": "0.2"},
{"type": "float", "value": "0.5"},
{"type": "integer", "value": "1"},
{"type": "integer", "value": "2"},
{"type": "integer", "value": "5"}
],
"string_array": [
{"type": "string", "value": "all"},
{"type": "string", "value": "strings"},
{"type": "string", "value": "are the same"},
{"type": "string", "value": "type"}
]
}
output from parser-cmd (stderr):
error: Uncaught (in promise) Error: should never reach
throw new Error("should never reach");
^
at Dumper.#printAsInlineValue (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:161:11)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:147:60
at Array.map ()
at Dumper.#printAsInlineValue (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:147:25)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:87:64
at Array.map ()
at Dumper.#printObject (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:87:29)
at Dumper.dump (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:45:36)
at stringify (file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/toml/stringify.ts:291:26)
at file:///home/martin/code/Toml/toml-test-matrix/src/js-deno-toml/deno-toml-encoder.ts:39:22
Exit 1
want:
FAIL valid/spec/array-1
Type for key "integers2" differs:
Expected: 1 (int64)
Your encoder: map[] (map[string]any)
input sent to parser-cmd:
{
"integers2": [
{"type": "integer", "value": "1"},
{"type": "integer", "value": "2"},
{"type": "integer", "value": "3"}
],
"integers3": [
{"type": "integer", "value": "1"},
{"type": "integer", "value": "2"}
]
}
output from parser-cmd (stdout):
[[integers2]]
[[integers2]]
[[integers2]]
[[integers3]]
[[integers3]]
want:
integers2 = [
1, 2, 3
]
integers3 = [
1,
2, # this is ok
]
FAIL valid/spec/array-of-tables-0
Could not find key "products.sku" in encoder output
input sent to parser-cmd:
{
"products": [
{
"name": {"type": "string", "value": "Hammer"},
"sku": {"type": "integer", "value": "738594937"}
},
{},
{
"color": {"type": "string", "value": "gray"},
"name": {"type": "string", "value": "Nail"},
"sku": {"type": "integer", "value": "284758393"}
}
]
}
output from parser-cmd (stdout):
[[products]]
name = "Hammer"
[[products]]
[[products]]
color = "gray"
name = "Nail"
want:
[[products]]
name = "Hammer"
sku = 738594937
[[products]] # empty table within the array
[[products]]
name = "Nail"
sku = 284758393
color = "gray"
FAIL valid/spec/array-of-tables-2
Could not find key "points.x" in encoder output
input sent to parser-cmd:
{
"points": [
{
"x": {"type": "integer", "value": "1"},
"y": {"type": "integer", "value": "2"},
"z": {"type": "integer", "value": "3"}
},
{
"x": {"type": "integer", "value": "7"},
"y": {"type": "integer", "value": "8"},
"z": {"type": "integer", "value": "9"}
},
{
"x": {"type": "integer", "value": "2"},
"y": {"type": "integer", "value": "4"},
"z": {"type": "integer", "value": "8"}
}
]
}
output from parser-cmd (stdout):
[[points]]
[[points]]
[[points]]
want:
points = [ { x = 1, y = 2, z = 3 },
{ x = 7, y = 8, z = 9 },
{ x = 2, y = 4, z = 8 } ]
FAIL valid/spec/float-2
decode TOML from encoder:
toml: line 4 (last key "sf4"): expected value but found "NaN" instead
input sent to parser-cmd:
{
"sf1": {"type": "float", "value": "inf"},
"sf2": {"type": "float", "value": "inf"},
"sf3": {"type": "float", "value": "-inf"},
"sf4": {"type": "float", "value": "nan"},
"sf5": {"type": "float", "value": "nan"},
"sf6": {"type": "float", "value": "nan"}
}
output from parser-cmd (stdout):
sf1 = inf
sf2 = inf
sf3 = -inf
sf4 = NaN
sf5 = NaN
sf6 = NaN
want:
# infinity
sf1 = inf # positive infinity
sf2 = +inf # positive infinity
sf3 = -inf # negative infinity
# not a number
sf4 = nan # actual sNaN/qNaN encoding is implementation-specific
sf5 = +nan # same as `nan`
sf6 = -nan # valid, actual encoding is implementation-specific
FAIL valid/spec/inline-table-0
Could not find key "point.x" in encoder output
input sent to parser-cmd:
{
"animal": {
"type": {
"name": {"type": "string", "value": "pug"}
}
},
"name": {
"first": {"type": "string", "value": "Tom"},
"last": {"type": "string", "value": "Preston-Werner"}
},
"point": {
"x": {"type": "integer", "value": "1"},
"y": {"type": "integer", "value": "2"}
}
}
output from parser-cmd (stdout):
[animal.type]
name = "pug"
[name]
first = "Tom"
last = "Preston-Werner"
[point]
want:
name = { first = "Tom", last = "Preston-Werner" }
point = { x = 1, y = 2 }
animal = { type.name = "pug" }
FAIL valid/spec/inline-table-1
Could not find key "point.x" in encoder output
input sent to parser-cmd:
{
"animal": {
"type": {
"name": {"type": "string", "value": "pug"}
}
},
"name": {
"first": {"type": "string", "value": "Tom"},
"last": {"type": "string", "value": "Preston-Werner"}
},
"point": {
"x": {"type": "integer", "value": "1"},
"y": {"type": "integer", "value": "2"}
}
}
output from parser-cmd (stdout):
[animal.type]
name = "pug"
[name]
first = "Tom"
last = "Preston-Werner"
[point]
want:
[name]
first = "Tom"
last = "Preston-Werner"
[point]
x = 1
y = 2
[animal]
type.name = "pug"
FAIL valid/spec/integer-0
Could not find key "int1" in encoder output
input sent to parser-cmd:
{
"int1": {"type": "integer", "value": "99"},
"int2": {"type": "integer", "value": "42"},
"int3": {"type": "integer", "value": "0"},
"int4": {"type": "integer", "value": "-17"}
}
output from parser-cmd (stdout):
want:
int1 = +99
int2 = 42
int3 = 0
int4 = -17
FAIL valid/spec/integer-1
Could not find key "int5" in encoder output
input sent to parser-cmd:
{
"int5": {"type": "integer", "value": "1000"},
"int6": {"type": "integer", "value": "5349221"},
"int7": {"type": "integer", "value": "5349221"},
"int8": {"type": "integer", "value": "12345"}
}
output from parser-cmd (stdout):
want:
int5 = 1_000
int6 = 5_349_221
int7 = 53_49_221 # Indian number system grouping
int8 = 1_2_3_4_5 # VALID but discouraged
FAIL valid/spec/integer-2
Could not find key "bin1" in encoder output
input sent to parser-cmd:
{
"bin1": {"type": "integer", "value": "214"},
"hex1": {"type": "integer", "value": "3735928559"},
"hex2": {"type": "integer", "value": "3735928559"},
"hex3": {"type": "integer", "value": "3735928559"},
"oct1": {"type": "integer", "value": "342391"},
"oct2": {"type": "integer", "value": "493"}
}
output from parser-cmd (stdout):
want:
# hexadecimal with prefix `0x`
hex1 = 0xDEADBEEF
hex2 = 0xdeadbeef
hex3 = 0xdead_beef
# octal with prefix `0o`
oct1 = 0o01234567
oct2 = 0o755 # useful for Unix file permissions
# binary with prefix `0b`
bin1 = 0b11010110
FAIL valid/spec/local-date-time-0
Values for key "ldt1" differ:
Expected: 1979-05-27 07:32:00 +0100 datetime-local (time.Time)
Your encoder: 1979-05-27 06:32:00 +0100 datetime-local (time.Time)
input sent to parser-cmd:
{
"ldt1": {"type": "datetime-local", "value": "1979-05-27T07:32:00"},
"ldt2": {"type": "datetime-local", "value": "1979-05-27T00:32:00.999"}
}
output from parser-cmd (stdout):
ldt1 = 1979-05-27T06:32:00.000
ldt2 = 1979-05-26T23:32:00.999
want:
ldt1 = 1979-05-27T07:32:00
ldt2 = 1979-05-27T00:32:00.999
FAIL valid/spec/local-time-0
decode TOML from encoder:
toml: line 1 (last key "lt1"): expected value but found "NaN" instead
input sent to parser-cmd:
{
"lt1": {"type": "time-local", "value": "07:32:00"},
"lt2": {"type": "time-local", "value": "00:32:00.999"}
}
output from parser-cmd (stdout):
lt1 = NaN-NaN-NaNTNaN:NaN:NaN.NaN
lt2 = NaN-NaN-NaNTNaN:NaN:NaN.NaN
want:
lt1 = 07:32:00
lt2 = 00:32:00.999
FAIL valid/spec/offset-date-time-0
Values for key "odt1" differ:
Expected: 1979-05-27 07:32:00 +0000 UTC (time.Time)
Your encoder: 1979-05-27 07:32:00 +0100 datetime-local (time.Time)
input sent to parser-cmd:
{
"odt1": {"type": "datetime", "value": "1979-05-27T07:32:00Z"},
"odt2": {"type": "datetime", "value": "1979-05-27T00:32:00-07:00"},
"odt3": {"type": "datetime", "value": "1979-05-27T00:32:00.999-07:00"}
}
output from parser-cmd (stdout):
odt1 = 1979-05-27T07:32:00.000
odt2 = 1979-05-27T07:32:00.000
odt3 = 1979-05-27T07:32:00.999
want:
odt1 = 1979-05-27T07:32:00Z
odt2 = 1979-05-27T00:32:00-07:00
odt3 = 1979-05-27T00:32:00.999-07:00
FAIL valid/spec/offset-date-time-1
Values for key "odt4" differ:
Expected: 1979-05-27 07:32:00 +0000 UTC (time.Time)
Your encoder: 1979-05-27 07:32:00 +0100 datetime-local (time.Time)
input sent to parser-cmd:
{
"odt4": {"type": "datetime", "value": "1979-05-27T07:32:00Z"}
}
output from parser-cmd (stdout):
odt4 = 1979-05-27T07:32:00.000
want:
odt4 = 1979-05-27 07:32:00Z
FAIL valid/spec/table-1
Could not find key "table-1.key2" in encoder output
input sent to parser-cmd:
{
"table-1": {
"key1": {"type": "string", "value": "some string"},
"key2": {"type": "integer", "value": "123"}
},
"table-2": {
"key1": {"type": "string", "value": "another string"},
"key2": {"type": "integer", "value": "456"}
}
}
output from parser-cmd (stdout):
[table-1]
key1 = "some string"
[table-2]
key1 = "another string"
want:
[table-1]
key1 = "some string"
key2 = 123
[table-2]
key1 = "another string"
key2 = 456
FAIL valid/string/escapes
decode TOML from encoder:
toml: line 4 (last key "delete"): TOML files cannot contain control characters: '0x7f'
input sent to parser-cmd:
{
"backslash": {"type": "string", "value": "|\\."},
"backspace": {"type": "string", "value": "|\b."},
"carriage": {"type": "string", "value": "|\r."},
"delete": {"type": "string", "value": "|."},
"formfeed": {"type": "string", "value": "|\f."},
"newline": {"type": "string", "value": "|\n."},
"notunicode1": {"type": "string", "value": "|\\u."},
"notunicode2": {"type": "string", "value": "|\\u."},
"notunicode3": {"type": "string", "value": "|\\u0075."},
"notunicode4": {"type": "string", "value": "|\\u."},
"quote": {"type": "string", "value": "|\"."},
"tab": {"type": "string", "value": "|\t."},
"unitseparator": {"type": "string", "value": "|\u001f."}
}
output from parser-cmd (stdout):
backslash = "|\\."
backspace = "|\b."
carriage = "|\r."
delete = "|."
formfeed = "|\f."
newline = "|\n."
notunicode1 = "|\\u."
notunicode2 = "|\\u."
notunicode3 = "|\\u0075."
notunicode4 = "|\\u."
quote = "|\"."
tab = "|\t."
unitseparator = "|\u001f."
want:
backspace = "|\b."
tab = "|\t."
newline = "|\n."
formfeed = "|\f."
carriage = "|\r."
quote = "|\"."
backslash = "|\\."
delete = "|\u007F."
unitseparator = "|\u001F."
# \u is escaped, so should NOT be interperted as a \u escape.
notunicode1 = "|\\u."
notunicode2 = "|\u005Cu."
notunicode3 = "|\\u0075."
notunicode4 = "|\\\u0075."
FAIL valid/string/quoted-unicode
decode TOML from encoder:
toml: line 2 (last key "escaped_string"): TOML files cannot contain control characters: '0x7f'
input sent to parser-cmd:
{
"basic_string": {"type": "string", "value": "~ € ÿ ퟿  ï¿¿ ð€€ ô¿¿"},
"escaped_string": {"type": "string", "value": "\u0000 \b \f A € ÿ ퟿  ï¿¿ ð€€ ô¿¿"},
"literal_string": {"type": "string", "value": "~ € ÿ ퟿  ï¿¿ ð€€ ô¿¿"},
"not_escaped_string": {
"type": "string",
"value": "\\u0000 \\u0008 \\u000c \\U00000041 \\u007f \\u0080 \\u00ff \\ud7ff \\ue000 \\uffff \\U00010000 \\U0010ffff"
}
}
output from parser-cmd (stdout):
basic_string = "~ € ÿ ퟿  ï¿¿ ð€€ ô¿¿"
escaped_string = "\u0000 \b \f A € ÿ ퟿  ï¿¿ ð€€ ô¿¿"
literal_string = "~ € ÿ ퟿  ï¿¿ ð€€ ô¿¿"
not_escaped_string = "\\u0000 \\u0008 \\u000c \\U00000041 \\u007f \\u0080 \\u00ff \\ud7ff \\ue000 \\uffff \\U00010000 \\U0010ffff"
want:
escaped_string = "\u0000 \u0008 \u000c \U00000041 \u007f \u0080 \u00ff \ud7ff \ue000 \uffff \U00010000 \U0010ffff"
not_escaped_string = '\u0000 \u0008 \u000c \U00000041 \u007f \u0080 \u00ff \ud7ff \ue000 \uffff \U00010000 \U0010ffff'
basic_string = "~ € ÿ ퟿  ï¿¿ ð€€ ô¿¿"
literal_string = '~ € ÿ ퟿  ï¿¿ ð€€ ô¿¿'
FAIL valid/table/array-implicit-and-explicit-after
Could not find key "a.y" in encoder output
input sent to parser-cmd:
{
"a": {
"b": [{
"x": {"type": "integer", "value": "1"}
}],
"y": {"type": "integer", "value": "2"}
}
}
output from parser-cmd (stdout):
[a]
[[a.b]]
want:
[[a.b]]
x = 1
[a]
y = 2
FAIL valid/table/array-within-dotted
Could not find key "fruit.apple.seeds.size" in encoder output
input sent to parser-cmd:
{
"fruit": {
"apple": {
"color": {"type": "string", "value": "red"},
"seeds": [{
"size": {"type": "integer", "value": "2"}
}]
}
}
}
output from parser-cmd (stdout):
[fruit.apple]
color = "red"
[[fruit.apple.seeds]]
want:
[fruit]
apple.color = "red"
[[fruit.apple.seeds]]
size = 2
FAIL valid/table/empty-name
Could not find key "x" in encoder output
input sent to parser-cmd:
{
"": {
"x": {"type": "integer", "value": "1"},
"a": {
"x": {"type": "integer", "value": "2"}
}
},
"a": {
"": {
"x": {"type": "integer", "value": "3"}
}
}
}
output from parser-cmd (stdout):
["".a]
[a.""]
want:
['']
x = 1
["".a]
x = 2
[a.'']
x = 3
FAIL valid/table/keyword-with-values
Could not find key "false.k" in encoder output
input sent to parser-cmd:
{
"false": {
"k": {"type": "integer", "value": "2"}
},
"inf": {
"k": {"type": "integer", "value": "3"}
},
"nan": {
"k": {"type": "integer", "value": "4"}
},
"true": {
"k": {"type": "integer", "value": "1"}
}
}
output from parser-cmd (stdout):
[false]
[inf]
[nan]
[true]
want:
[true]
k = 1
[false]
k = 2
[inf]
k = 3
[nan]
k = 4
FAIL valid/table/names-with-values
Could not find key "a. x .key" in encoder output
input sent to parser-cmd:
{
"a": {
" x ": {
"key": {"type": "integer", "value": "4"}
},
"b": {
"c": {
"key": {"type": "integer", "value": "1"}
}
},
"b.c": {
"key": {"type": "integer", "value": "2"}
},
"d.e": {
"key": {"type": "integer", "value": "3"}
}
},
"d": {
"e": {
"f": {
"key": {"type": "integer", "value": "5"}
}
}
},
"g": {
"h": {
"i": {
"key": {"type": "integer", "value": "6"}
}
}
},
"j": {
"Êž": {
"l": {
"key": {"type": "integer", "value": "7"}
}
}
},
"x": {
"1": {
"2": {
"key": {"type": "integer", "value": "8"}
}
}
}
}
output from parser-cmd (stdout):
[a." x "]
[a.b.c]
[a."b.c"]
[a."d.e"]
[d.e.f]
[g.h.i]
[j."Êž".l]
[x.1.2]
want:
[a.b.c]
key = 1
[a."b.c"]
key = 2
[a.'d.e']
key = 3
[a.' x ']
key = 4
[ d.e.f ]
key = 5
[ g . h . i ]
key = 6
[ j . "Êž" . 'l' ]
key = 7
[x.1.2]
key = 8
FAIL valid/table/sub
Could not find key "a.key" in encoder output
input sent to parser-cmd:
{
"a": {
"key": {"type": "integer", "value": "1"},
"extend": {
"key": {"type": "integer", "value": "2"},
"more": {
"key": {"type": "integer", "value": "3"}
}
}
}
}
output from parser-cmd (stdout):
[a.extend.more]
want:
[a]
key = 1
# a.extend is a key inside the "a" table.
[a.extend]
key = 2
[a.extend.more]
key = 3
FAIL valid/table/with-literal-string
Could not find key "a.\"b\".c.answer" in encoder output
input sent to parser-cmd:
{
"a": {
"\"b\"": {
"c": {
"answer": {"type": "integer", "value": "42"}
}
}
}
}
output from parser-cmd (stdout):
[a."\"b\"".c]
want:
['a']
[a.'"b"']
[a.'"b"'.c]
answer = 42
FAIL valid/table/with-pound
Could not find key "key#group.answer" in encoder output
input sent to parser-cmd:
{
"key#group": {
"answer": {"type": "integer", "value": "42"}
}
}
output from parser-cmd (stdout):
["key#group"]
want:
["key#group"]
answer = 42
FAIL valid/table/with-single-quotes
Could not find key "a.b.c.answer" in encoder output
input sent to parser-cmd:
{
"a": {
"b": {
"c": {
"answer": {"type": "integer", "value": "42"}
}
}
}
}
output from parser-cmd (stdout):
[a.b.c]
want:
['a']
[a.'b']
[a.'b'.c]
answer = 42
FAIL valid/table/without-super-with-values
Could not find key "x.c" in encoder output
input sent to parser-cmd:
{
"x": {
"c": {"type": "integer", "value": "3"},
"d": {"type": "integer", "value": "4"},
"y": {
"z": {
"w": {
"a": {"type": "integer", "value": "1"},
"b": {"type": "integer", "value": "2"}
}
}
}
}
}
output from parser-cmd (stdout):
[x.y.z.w]
want:
# [x] you
# [x.y] don't
# [x.y.z] need these
[x.y.z.w] # for this to work
a = 1
b = 2
[x] # defining a super-table afterwards is ok
c = 3
d = 4
toml-test v2025-04-19 [./deno-toml-encoder.ts]: using embedded tests, 1 skipped
encoder tests: 105 passed, 88 failed
took 0.0 0.0