Permalink
Browse files

Valuewrapper test

  • Loading branch information...
1 parent a3515ca commit 9bd39fe4fa80307167fbc26290aaa188d57f5485 @v-for-vandal v-for-vandal committed Nov 11, 2013
Showing with 17 additions and 0 deletions.
  1. +17 −0 Examples/test-suite/lua/valuewrapper_runme.lua
View
17 Examples/test-suite/lua/valuewrapper_runme.lua
@@ -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)

0 comments on commit 9bd39fe

Please sign in to comment.