mirror of
https://github.com/TangentFoxy/inspect.lua.git
synced 2025-07-28 02:52:18 +00:00
changed 'tostring' from a field of inspect to a local variable
This commit is contained in:
@@ -414,9 +414,7 @@ describe( 'inspect', function()
|
||||
|
||||
it('allows changing the global tostring', function()
|
||||
local save = _G.tostring
|
||||
_G.tostring = function(x)
|
||||
return inspect(x)
|
||||
end
|
||||
_G.tostring = inspect
|
||||
local s = tostring({1, 2, 3})
|
||||
_G.tostring = save
|
||||
assert.equals("{ 1, 2, 3 }", s)
|
||||
|
Reference in New Issue
Block a user