tinytoml version bb76d06
FAIL valid/float/long
Values for key "longpi" don't match:
Expected: 3.141592653589793
Your encoder: 3.1415926535898
input sent to parser-cmd:
longpi = 3.141592653589793
neglongpi = -3.141592653589793
output from parser-cmd (stdout):
{
"longpi": {"type": "float", "value": "3.1415926535898"},
"neglongpi": {"type": "float", "value": "-3.1415926535898"}
}
want:
{
"longpi": {"type": "float", "value": "3.141592653589793"},
"neglongpi": {"type": "float", "value": "-3.141592653589793"}
}
FAIL valid/float/max-int
Values for key "max_float" don't match:
Expected: 9.007199254740991e+15
Your encoder: 9.007199254741e+15
input sent to parser-cmd:
# Maximum and minimum safe natural numbers.
max_float = 9_007_199_254_740_991.0
min_float = -9_007_199_254_740_991.0
output from parser-cmd (stdout):
{
"max_float": {"type": "float", "value": "9.007199254741e+15"},
"min_float": {"type": "float", "value": "-9.007199254741e+15"}
}
want:
{
"max_float": {"type": "float", "value": "9007199254740991"},
"min_float": {"type": "float", "value": "-9007199254740991"}
}
FAIL valid/inline-table/array-values
Malformed output from your encoder: 'value' is not a JSON array: map[string]any
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 (stdout):
{
"a": {
"a": {}
},
"b": {
"a": [
{"type": "integer", "value": "1"},
{"type": "integer", "value": "2"}
],
"b": [
{"type": "integer", "value": "3"},
{"type": "integer", "value": "4"}
]
}
}
want:
{
"a": {"a": []},
"b": {
"a": [
{"type": "integer", "value": "1"},
{"type": "integer", "value": "2"}
],
"b": [
{"type": "integer", "value": "3"},
{"type": "integer", "value": "4"}
]
}
}
FAIL valid/spec/float-1
Values for key "flt8" don't match:
Expected: 224617.445991228
Your encoder: 224617.44599123
input sent to parser-cmd:
flt8 = 224_617.445_991_228
output from parser-cmd (stdout):
{
"flt8": {"type": "float", "value": "224617.44599123"}
}
want:
{
"flt8": {"type": "float", "value": "224617.445991228"}
}
FAIL invalid/inline-table/trailing-comma
Expected an error, but no error was reported.
input sent to parser-cmd:
# A terminating comma (also called trailing comma) is not permitted after the
# last key/value pair in an inline table
abc = { abc = 123, }
output from parser-cmd (stdout):
{
"abc": {
"abc": {"type": "integer", "value": "123"}
}
}
want:
Exit code 1
toml-test v2025-04-19 [./lua-tinytoml-decoder]: using embedded tests, 1 skipped
valid tests: 189 passed, 4 failed
invalid tests: 376 passed, 1 failed
==> ENCODER TESTS
(not supported)
took 0.0 0.0