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

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

#
Lua | 20 lines | 18 code | 1 blank | 1 comment | 0 complexity | 3e36af10675d0e3ae10eafb2d9aa2f0d MD5 | raw file
 1require("import")	-- the import fn
 2import("enums")	-- import lib
 3
 4-- catch "undefined" global variables
 5setmetatable(getfenv(),{__index=function (t,i) error("undefined global variable `"..i.."'",2) end})
 6
 7-- check values
 8assert(enums.CSP_ITERATION_FWD==0)
 9assert(enums.CSP_ITERATION_BWD==11)
10assert(enums.ABCDE==0)
11assert(enums.FGHJI==1)
12assert(enums.boo==0)
13assert(enums.hoo==5)
14assert(enums.globalinstance1==0)
15assert(enums.globalinstance2==1)
16assert(enums.globalinstance3==30)
17assert(enums.AnonEnum1==0)
18assert(enums.AnonEnum2==100)
19
20-- no point in checking fns, C will allow any value