feat(sandbox) return multiple values

This commit is contained in:
eskerda
2020-12-13 18:54:40 +01:00
committed by Enrique García Cota
parent 8974b8869c
commit 9f83b8914a
2 changed files with 9 additions and 3 deletions

View File

@@ -34,6 +34,11 @@ describe('sandbox.run', function()
assert.error(function() sandbox.run('return setmetatable({}, {})') end)
assert.error(function() sandbox.run('return string.rep("hello", 5)') end)
end)
it('does return multiple values', function()
local result = { sandbox.run("return 'hello', 'world'") }
assert.same({ 'hello', 'world' }, result)
end)
end)
describe('when handling string.rep', function()