PageRenderTime 9ms CodeModel.GetById 1ms app.highlight 3ms RepoModel.GetById 2ms app.codeStats 0ms

/trunk/Examples/test-suite/lua/exception_partial_info_runme.lua

#
Lua | 12 lines | 10 code | 1 blank | 1 comment | 0 complexity | 669b00bc176ec9110f2caa52ce74e228 MD5 | raw file
 1require("import")	-- the import fn
 2import("exception_partial_info")	-- import code
 3
 4-- catch "undefined" global variables
 5setmetatable(getfenv(),{__index=function (t,i) error("undefined global variable `"..i.."'",2) end})
 6
 7imp=exception_partial_info.Impl()
 8
 9-- trying to call throwing methods
10-- should fail
11assert(pcall(function() imp:f1() end)==false)
12assert(pcall(function() imp:f2() end)==false)