mirror of
https://github.com/kikito/inspect.lua.git
synced 2024-12-15 14:34:21 +00:00
fix problem reported by coverage analysis
This commit is contained in:
parent
d051ae061c
commit
61d02902b3
@ -415,12 +415,8 @@ describe( 'inspect', function()
|
|||||||
it('allows changing the global tostring', function()
|
it('allows changing the global tostring', function()
|
||||||
local save = _G.tostring
|
local save = _G.tostring
|
||||||
_G.tostring = function(x)
|
_G.tostring = function(x)
|
||||||
if type(x) == "string" then
|
|
||||||
return x
|
|
||||||
else
|
|
||||||
return inspect(x)
|
return inspect(x)
|
||||||
end
|
end
|
||||||
end
|
|
||||||
local s = tostring({1, 2, 3})
|
local s = tostring({1, 2, 3})
|
||||||
_G.tostring = save
|
_G.tostring = save
|
||||||
assert.equals("{ 1, 2, 3 }", s)
|
assert.equals("{ 1, 2, 3 }", s)
|
||||||
|
Loading…
Reference in New Issue
Block a user