diff options
Diffstat (limited to 'Tools/LuaMacro/tests/test-scope.lua')
-rw-r--r-- | Tools/LuaMacro/tests/test-scope.lua | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Tools/LuaMacro/tests/test-scope.lua b/Tools/LuaMacro/tests/test-scope.lua new file mode 100644 index 0000000..8007225 --- /dev/null +++ b/Tools/LuaMacro/tests/test-scope.lua @@ -0,0 +1,17 @@ +-- simple macros created using def_ are lexically scoped
+do
+ def_ X 42
+ assert(X == 42)
+ do
+ def_ X 'hello'
+ assert(X == 'hello')
+ do
+ def_ X 999
+ assert (X == 999)
+ end
+ assert(X == 'hello')
+ end
+ assert(X == 42)
+end
+assert (X==nil)
+
|