changed 'tostring' from a field of inspect to a local variable

This commit is contained in:
Andreas Hofer
2016-04-03 20:00:37 +02:00
parent 61d02902b3
commit e091fcd43d
2 changed files with 6 additions and 8 deletions

View File

@@ -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)