summaryrefslogtreecommitdiff
path: root/Tools/LuaMacro/tests/test-mod.lua
blob: 2d51cb0cbecf200a7b41022438dacc57acb4bf8d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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")