Merge pull request #27 from andreashofer123/tostring

fix endless recursion when using inspect to reimplement global tostring
This commit is contained in:
Enrique García
2016-04-08 19:26:28 +02:00
2 changed files with 13 additions and 2 deletions

View File

@@ -417,4 +417,13 @@ describe( 'inspect', function()
end)
end)
end)
it('allows changing the global tostring', function()
local save = _G.tostring
_G.tostring = inspect
local s = tostring({1, 2, 3})
_G.tostring = save
assert.equals("{ 1, 2, 3 }", s)
end)
end)