summaryrefslogtreecommitdiff
path: root/server/test/full/normal.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-01-31 17:05:41 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-01-31 17:05:41 +0800
commit92424baf13c2487145456e4062f9f4214f8b7bcd (patch)
tree0835f58c26c16cec0b2671e759ac70fcc2bc5c67 /server/test/full/normal.lua
parenta692d7b413e4aff34a2a714cc6aec9ad0b495b33 (diff)
downloadlua-language-server-92424baf13c2487145456e4062f9f4214f8b7bcd.zip
整理代码
Diffstat (limited to 'server/test/full/normal.lua')
-rw-r--r--server/test/full/normal.lua128
1 files changed, 128 insertions, 0 deletions
diff --git a/server/test/full/normal.lua b/server/test/full/normal.lua
new file mode 100644
index 00000000..02b1f4f0
--- /dev/null
+++ b/server/test/full/normal.lua
@@ -0,0 +1,128 @@
+TEST [[
+do
+ x = 1
+end
+]]
+
+TEST [[
+return nil, 1, true, 'xx'
+]]
+
+TEST [[
+return a
+]]
+
+TEST [[
+retrun a.b:c(1, 2, ...)[1][name]
+]]
+
+TEST [[
+return 1 + 1
+]]
+
+TEST [[
+return -1
+]]
+
+TEST [[
+return ...
+]]
+
+TEST [[
+return function (a, b, ...)
+end
+]]
+
+TEST [[
+return {
+ a = 1,
+ b = {
+ c = d,
+ e = f,
+ },
+ g,
+ h,
+ 1,
+}
+]]
+
+TEST [[
+::LABEL::
+goto LABEL
+goto NEXT
+::NEXT::
+]]
+
+TEST [[
+a, b, c = 1, 2, ...
+]]
+
+TEST [[
+local a, b, c = 1, 2, ...
+]]
+
+TEST [[
+a[#a+1] = 1
+]]
+
+TEST [[
+xx(a, b, 2, 3, ...)
+]]
+
+TEST [[
+if a then
+elseif b then
+elseif c then
+else
+end
+]]
+
+TEST [[
+for i = 1, 10, 1 do
+end
+]]
+
+TEST [[
+for a, b, c in pairs(t) do
+end
+]]
+
+TEST [[
+while true do
+end
+]]
+
+TEST [[
+repeat
+until true
+]]
+
+TEST [[
+function xx:yy(a, b, c, ...)
+end
+]]
+
+TEST [[
+local function xx(a, b, c, ...)
+end
+]]
+
+TEST [[
+local v = 1
+local function xx()
+ print(v)
+end
+local v = 2
+xx()
+]]
+
+TEST [[
+return {
+ 1, 2, 3
+}
+]]
+
+TEST [[
+return function ()
+end
+]]