mirror of
https://github.com/TangentFoxy/inspect.lua.git
synced 2025-07-28 02:52:18 +00:00
Fix float keys being masked in tables with array elements
This commit is contained in:
@@ -80,6 +80,11 @@ describe( 'inspect', function()
|
||||
assert.equals(inspect({a = 1, b = 2}), "{\n a = 1,\n b = 2\n}")
|
||||
end)
|
||||
|
||||
it('identifies numeric non-array keys as dictionary keys', function()
|
||||
assert.equals(inspect({1, 2, [-1] = true}), "{ 1, 2,\n [-1] = true\n}")
|
||||
assert.equals(inspect({1, 2, [1.5] = true}), "{ 1, 2,\n [1.5] = true\n}")
|
||||
end)
|
||||
|
||||
it('sorts keys in dictionary tables', function()
|
||||
local t = { 1,2,3,
|
||||
[print] = 1, ["buy more"] = 1, a = 1,
|
||||
|
Reference in New Issue
Block a user