mirror of
https://github.com/kikito/inspect.lua.git
synced 2024-12-15 14:34:21 +00:00
fixes __len issue using rawlen instead of #t in a couple places
This commit is contained in:
parent
162d497b0d
commit
4f9761b631
@ -78,7 +78,7 @@ describe( 'inspect', function()
|
|||||||
if has_rawlen then
|
if has_rawlen then
|
||||||
it('handles arrays with a __len metatable correctly (ignoring the __len metatable and using rawlen)', function()
|
it('handles arrays with a __len metatable correctly (ignoring the __len metatable and using rawlen)', function()
|
||||||
local arr = setmetatable({1,2,3}, {__len = function() return nil end})
|
local arr = setmetatable({1,2,3}, {__len = function() return nil end})
|
||||||
assert.equals("{ 1, 2, 3 }", inspect(arr))
|
assert.equals("{ 1, 2, 3,\n <metatable> = {\n __len = <function 1>\n }\n}", inspect(arr))
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user