mirror of
https://github.com/kikito/inspect.lua.git
synced 2024-12-15 14:34:21 +00:00
remove unused values & params
This commit is contained in:
parent
3eb9c65c7b
commit
f153849088
@ -267,7 +267,6 @@ function Inspector:putTable(t)
|
|||||||
self:tabify()
|
self:tabify()
|
||||||
self:puts('<metatable> = ')
|
self:puts('<metatable> = ')
|
||||||
self:putValue(mt)
|
self:putValue(mt)
|
||||||
count = count + 1
|
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
@ -260,13 +260,13 @@ describe( 'inspect', function()
|
|||||||
|
|
||||||
it('changes keys', function()
|
it('changes keys', function()
|
||||||
local dict = {a = 1}
|
local dict = {a = 1}
|
||||||
local changeKey = function(item, path) return item == 'a' and 'x' or item end
|
local changeKey = function(item) return item == 'a' and 'x' or item end
|
||||||
assert.equals(inspect(dict, {process = changeKey}), '{\n x = 1\n}')
|
assert.equals(inspect(dict, {process = changeKey}), '{\n x = 1\n}')
|
||||||
end)
|
end)
|
||||||
|
|
||||||
it('nullifies keys', function()
|
it('nullifies keys', function()
|
||||||
local dict = {a = 1, b = 2}
|
local dict = {a = 1, b = 2}
|
||||||
local removeA = function(item, path) return item ~= 'a' and item or nil end
|
local removeA = function(item) return item ~= 'a' and item or nil end
|
||||||
assert.equals(inspect(dict, {process = removeA}), '{\n b = 2\n}')
|
assert.equals(inspect(dict, {process = removeA}), '{\n b = 2\n}')
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user