summaryrefslogtreecommitdiff
path: root/server/test/implementation/local.lua
diff options
context:
space:
mode:
Diffstat (limited to 'server/test/implementation/local.lua')
-rw-r--r--server/test/implementation/local.lua191
1 files changed, 191 insertions, 0 deletions
diff --git a/server/test/implementation/local.lua b/server/test/implementation/local.lua
new file mode 100644
index 00000000..7e9b3db0
--- /dev/null
+++ b/server/test/implementation/local.lua
@@ -0,0 +1,191 @@
+TEST [[
+local <!x!>
+<?x?> = 1
+]]
+
+TEST [[
+local z, y, <!x!>
+<?x?> = 1
+]]
+
+TEST [[
+local <!x!> = 1
+<?x?> = 1
+]]
+
+TEST [[
+local z, y, <!x!> = 1
+<?x?> = 1
+]]
+
+TEST [[
+local x
+local <!x!>
+<?x?> = 1
+]]
+
+TEST [[
+local <!x!>
+do
+ <?x?> = 1
+end
+]]
+
+TEST [[
+local <!x!>
+do
+ local x
+end
+<?x?> = 1
+]]
+
+TEST [[
+local <!x!>
+if <?x?> then
+ local x
+end
+]]
+
+TEST [[
+local <!x2!>
+if x2 then
+ local x2
+elseif <?x2?> then
+ local x2
+end
+]]
+
+TEST [[
+local <!x!>
+if x then
+ local x
+elseif x then
+ local x
+else
+ local x
+end
+<?x?> = 1
+]]
+
+TEST [[
+local <!x!>
+if x then
+ <?x?> = 1
+elseif x then
+ local x
+else
+ local x
+end
+]]
+
+TEST [[
+local <!x!>
+for x = 1, 10 do
+end
+<?x?> = 1
+]]
+
+TEST [[
+local x
+for <!x!> = 1, 10 do
+ <?x?> = 1
+end
+]]
+
+TEST [[
+local <!x!>
+for x in x do
+end
+<?x?> = 1
+]]
+
+TEST [[
+local <!x!>
+for x in <?x?> do
+end
+]]
+
+TEST [[
+local x
+for <!x!> in x do
+ <?x?> = 1
+end
+]]
+
+TEST [[
+local x
+for z, y, <!x!> in x do
+ <?x?> = 1
+end
+]]
+
+TEST [[
+local <!x!>
+while <?x?> do
+end
+]]
+
+TEST [[
+local <!x!>
+while x do
+ <?x?> = 1
+end
+]]
+
+TEST [[
+local <!x!>
+while x do
+ local x
+end
+<?x?> = 1
+]]
+
+TEST [[
+local <!x!>
+repeat
+ <?x?> = 1
+until true
+]]
+
+TEST [[
+local <!x!>
+repeat
+ local x
+until true
+<?x?> = 1
+]]
+
+TEST [[
+local <!x!>
+repeat
+until <?x?>
+]]
+
+TEST [[
+local x
+repeat
+ local <!x!>
+until <?x?>
+]]
+
+TEST [[
+local <!x!>
+function _()
+ local x
+end
+<?x?> = 1
+]]
+
+TEST [[
+local <!x!>
+return function ()
+ <?x?> = 1
+end
+]]
+
+TEST [[
+local <!x!>
+local x = function ()
+ <?x?> = 1
+end
+]]