summaryrefslogtreecommitdiff
path: root/server-beta/test/definition/set.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-09-24 20:45:45 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-09-24 20:45:45 +0800
commitff4f52962550da919b737f0f78bbaa4a507d6ba9 (patch)
treeb6d6e3f6224ac81cec6195f43a2fe238a60a3eee /server-beta/test/definition/set.lua
parent5c8022df4adaaf813812845f97d9cb9d7c6d4fcc (diff)
downloadlua-language-server-ff4f52962550da919b737f0f78bbaa4a507d6ba9.zip
导入测试
Diffstat (limited to 'server-beta/test/definition/set.lua')
-rw-r--r--server-beta/test/definition/set.lua50
1 files changed, 50 insertions, 0 deletions
diff --git a/server-beta/test/definition/set.lua b/server-beta/test/definition/set.lua
new file mode 100644
index 00000000..44277d33
--- /dev/null
+++ b/server-beta/test/definition/set.lua
@@ -0,0 +1,50 @@
+TEST [[
+<!x!> = 1
+<?x?>()
+]]
+
+TEST [[
+do
+ <!global!> = 1
+end
+<?global?>()
+]]
+
+TEST [[
+<!x!> = 1
+do
+ local x = 1
+end
+<?x?>()
+]]
+
+TEST [[
+x = 1
+do
+ local <!x!> = 1
+ do
+ <!x!> = 2
+ end
+ <?x?>()
+end
+]]
+
+TEST [[
+<!x!> = 1
+if y then
+ <!x!> = 2
+else
+ <!x!> = 3
+end
+print(<?x?>)
+]]
+
+TEST [[
+_G.<!x!> = 1
+print(<?x?>)
+]]
+
+TEST [[
+rawset<!(_G, 'x', 1)!>
+print(<?x?>)
+]]