Skip to content

Commit 69e5dd1

Browse files
author
BirdeeHub
committed
ci(tests): removed debug print, added a test
1 parent f2d841c commit 69e5dd1

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

tests/decode_tests.lua

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,23 @@ key = "value" # This is an end-of-line comment
429429
it(#data.fruit[2].varieties == 1, "Second fruit should have one variety")
430430
end)
431431

432+
define("inline stuff should block later headings", function()
433+
local errtoml = [=[
434+
fruits = []
435+
[[fruits]]
436+
name = "apple"
437+
]=]
438+
local _, err = tomlua_default.decode(errtoml)
439+
it(err ~= nil, "Array version should error")
440+
errtoml = [=[
441+
database = {}
442+
[database]
443+
type = "postgres"
444+
]=]
445+
_, err = tomlua_default.decode(errtoml)
446+
it(err ~= nil, "Table version should error")
447+
end)
448+
432449
define("duplicate table array error", function()
433450
local toml_str = [=[
434451
[[table]]
@@ -451,7 +468,6 @@ date_only = 1979-05-27
451468
time_only = 07:32:00
452469
]]
453470
local data, err = tomlua_fancy_dates.decode(toml_str)
454-
print((data or {}).time_only, err)
455471
it(err == nil, "Should not error")
456472
it(type(data.date_offset) == "userdata", "Offset datetime should be userdata")
457473
it(data.date_offset.year == 1979 and data.date_offset.month == 5 and data.date_offset.day == 27, "Offset datetime components should be correct")

0 commit comments

Comments
 (0)