Skip to content

Commit 89b93d9

Browse files
author
BirdeeHub
committed
ci(tests): made a decision
1 parent 6ec9382 commit 89b93d9

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

tests/encode_tests.lua

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -368,14 +368,16 @@ World"""]=], nil, true) ~= nil, "Encoded multiline string should be correct")
368368
-- This might actually be the correct behavior
369369
define("encode table with array of inline tables", function()
370370
local test_table = {
371-
points = {
372-
setmetatable({ x = 1, y = 3 }, { toml_type = "TABLE_INLINE" }),
373-
setmetatable({ x = 3, y = 4 }, { toml_type = tomlua_default.types.TABLE_INLINE })
374-
}
371+
points = setmetatable({
372+
{ x = 1, y = 3 },
373+
{ x = 3, y = 4 }
374+
}, {
375+
toml_type = "ARRAY_INLINE"
376+
})
375377
}
376378
local encoded_str, err = tomlua_default.encode(test_table)
377379
it(err == nil, "Should not error during encoding")
378-
it(string.find(encoded_str, "points = %[%s+{ [xy] = [12], [xy] = [12] },%s+{ [xy] = [34], [xy] = [34] }%s+]", nil) ~= nil, "Encoded array of inline tables should be correct")
380+
it(string.find(encoded_str, "points = %[%s+{ [xy] = [1234], [xy] = [1234] },%s+{ [xy] = [1234], [xy] = [1234] }%s+]") ~= nil, "Encoded array of inline tables should be correct")
379381
end)
380382

381383
define("encode table with array of arrays", function()

0 commit comments

Comments
 (0)