Skip to content
Snippets Groups Projects
Unverified Commit 5abddd29 authored by Matthias Schiffer's avatar Matthias Schiffer
Browse files

scripts/check_site.lua: fix array_to_string with non-string/number array elements

Fixes need_one_of() with boolean elements.
parent ddb11ddd
No related branches found
No related tags found
No related merge requests found
......@@ -65,8 +65,20 @@ local function path_to_string(path)
return table.concat(path, '.')
end
local function format(val)
if type(val) == 'string' then
return string.format('%q', val)
else
return tostring(val)
end
end
local function array_to_string(array)
return '[' .. table.concat(array, ', ') .. ']'
local strings = {}
for i, v in ipairs(array) do
strings[i] = format(v)
end
return '[' .. table.concat(strings, ', ') .. ']'
end
function table_keys(tbl)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment