mirror of
https://github.com/TangentFoxy/inspect.lua.git
synced 2025-07-28 02:52:18 +00:00
Merge pull request #27 from andreashofer123/tostring
fix endless recursion when using inspect to reimplement global tostring
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user