mirror of
https://github.com/TangentFoxy/inspect.lua.git
synced 2025-07-28 02:52:18 +00:00
added metatable support
This commit is contained in:
@@ -147,6 +147,19 @@ context( 'inspect', function()
|
||||
|
||||
end)
|
||||
|
||||
test('Should include the metatable as an extra hash attribute', function()
|
||||
local foo = { foo = 1, __tostring = function(k) return 'foo' end }
|
||||
local bar = setmetatable({a = 1}, foo)
|
||||
assert_equal(inspect(bar), [[{
|
||||
a = 1,
|
||||
<metatable> = {
|
||||
__tostring = <function>
|
||||
foo = 1,
|
||||
}
|
||||
}]])
|
||||
end)
|
||||
|
||||
|
||||
end)
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user