summaryrefslogtreecommitdiff
path: root/Tools/LuaMacro/tests/test-mod.lua
diff options
context:
space:
mode:
Diffstat (limited to 'Tools/LuaMacro/tests/test-mod.lua')
-rw-r--r--Tools/LuaMacro/tests/test-mod.lua20
1 files changed, 20 insertions, 0 deletions
diff --git a/Tools/LuaMacro/tests/test-mod.lua b/Tools/LuaMacro/tests/test-mod.lua
new file mode 100644
index 0000000..2d51cb0
--- /dev/null
+++ b/Tools/LuaMacro/tests/test-mod.lua
@@ -0,0 +1,20 @@
+local mod = require 'mod'
+-- def_ show(expr) print(_STR_(expr),expr)
+
+assert(mod.one() == 42)
+
+f = mod.Fred(22)
+
+assert(f:get() == 22)
+f:set2()
+assert(f:get() == 0)
+
+a = mod.Alice()
+a:set2()
+assert(a:get() == 1)
+a:set(66)
+assert(tostring(a) == "Alice 66")
+
+
+
+