summaryrefslogtreecommitdiff
path: root/server/test/implementation/local.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2018-11-20 18:40:33 +0800
committer最萌小汐 <sumneko@hotmail.com>2018-11-20 18:40:33 +0800
commit67f6a20b27c98788843883c3712c648e110d781f (patch)
tree209705e0bc3c2c44d5ffade78cc2c7041eeffdda /server/test/implementation/local.lua
parenta65a1ddb13854c2dfde4c04630a0a942abdafa32 (diff)
downloadlua-language-server-67f6a20b27c98788843883c3712c648e110d781f.zip
转移目录
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
+]]