diff options
Diffstat (limited to 'example/simple-example.lua')
-rw-r--r-- | example/simple-example.lua | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/example/simple-example.lua b/example/simple-example.lua index 33f62e8..327167f 100644 --- a/example/simple-example.lua +++ b/example/simple-example.lua @@ -44,3 +44,12 @@ setmetatable(tab, mt) -- Finally, run the subcode print(supple.host.run(subcode, "@test-code", tab)) assert(tab.tot == 24) + +-- Now run a supple command which we expect to error out. +print(supple.host.run("unknown()", "@test-code")) + +-- And now, one where we pass an error from host to sandbox and back +print(supple.host.run("local f = ... f()", "@test-code", function() unknown() end)) + +-- And now, one where we pass an error from sandbox to host to sandbox and back +print(supple.host.run("local f = ... f(function() unknown() end)", "@test-code", function(ff) ff() end)) |