Valuewrapper test
This commit is contained in:
parent
a3515ca450
commit
9bd39fe4fa
1 changed files with 17 additions and 0 deletions
17
Examples/test-suite/lua/valuewrapper_runme.lua
Normal file
17
Examples/test-suite/lua/valuewrapper_runme.lua
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
require("import") -- the import fn
|
||||||
|
import("valuewrapper") -- import code
|
||||||
|
v=valuewrapper -- renaming import
|
||||||
|
|
||||||
|
-- catch "undefined" global variables
|
||||||
|
local env = _ENV -- Lua 5.2
|
||||||
|
if not env then env = getfenv () end -- Lua 5.1
|
||||||
|
setmetatable(env, {__index=function (t,i) error("undefined global variable `"..i.."'",2) end})
|
||||||
|
|
||||||
|
assert(v.Xi ~= nil)
|
||||||
|
assert(v.YXi ~= nil)
|
||||||
|
|
||||||
|
x1 = v.Xi(5)
|
||||||
|
|
||||||
|
y1 =v.YXi()
|
||||||
|
assert(y1:spam(x1) == 0)
|
||||||
|
assert(y1:spam() == 0)
|
||||||
Loading…
Add table
Add a link
Reference in a new issue