summaryrefslogtreecommitdiff
path: root/test/diagnostics/unused-local.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2023-08-10 17:44:22 +0800
committer最萌小汐 <sumneko@hotmail.com>2023-08-11 17:57:29 +0800
commit5a0804e9869382b8d2f1fa1fffd362dc2fea9c52 (patch)
treea14dbccabb8b82c2cd313a12a80182b37e05a9b5 /test/diagnostics/unused-local.lua
parentdab3ea38d3b44ad1d144889698b4311a40e7e9dc (diff)
downloadlua-language-server-5a0804e9869382b8d2f1fa1fffd362dc2fea9c52.zip
clean up tests
Diffstat (limited to 'test/diagnostics/unused-local.lua')
-rw-r--r--test/diagnostics/unused-local.lua25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/diagnostics/unused-local.lua b/test/diagnostics/unused-local.lua
new file mode 100644
index 00000000..4e8294bf
--- /dev/null
+++ b/test/diagnostics/unused-local.lua
@@ -0,0 +1,25 @@
+TEST [[
+local <!x!>
+]]
+
+TEST [[
+local y
+local x <close> = y
+]]
+
+TEST [[
+local function x()
+end
+x()
+]]
+
+TEST [[
+return function (x)
+ x.a = 1
+end
+]]
+
+TEST [[
+local <!t!> = {}
+<!t!>.a = 1
+]]