naming & refactoring

This commit is contained in:
kikito
2013-09-03 13:20:38 +02:00
parent 3a90dc3319
commit c1e5b44938
2 changed files with 13 additions and 7 deletions

View File

@@ -40,13 +40,19 @@ describe('sandbox', function()
describe('when handling infinite loops', function()
it('throws an error with infinite loops', function()
assert.has_error(function() sandbox("while true do end") end)
end)
it('restores string.rep even after a while true', function()
assert.has_error(function() sandbox("while true do end") end)
assert.equal('hellohello', string.rep('hello', 2))
end)
it('#focus accepts a limit param', function()
--assert.no_has_error(function() sandbox("for i=1,10000 do end") end)
assert.has_error(function() sandbox("for i=1,10000 do end", {limit = 50}) end)
assert.no_has_error(function() sandbox("for i=1,100 do end") end)
assert.has_error(function() sandbox("for i=1,100 do end", {limit = 50}) end)
end)
end)