summaryrefslogtreecommitdiff
path: root/Examples/test-suite/lua/exception_partial_info_runme.lua
blob: fb0e5146ed2407fc67535c3d9a9caa337cbc4704 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
require("import")	-- the import fn
import("exception_partial_info")	-- import code

-- catch "undefined" global variables
setmetatable(getfenv(),{__index=function (t,i) error("undefined global variable `"..i.."'",2) end})

imp=exception_partial_info.Impl()

-- trying to call throwing methods
-- should fail
assert(pcall(function() imp:f1() end)==false)
assert(pcall(function() imp:f2() end)==false)