summaryrefslogtreecommitdiff
path: root/test/diagnostics/unused-function.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/diagnostics/unused-function.lua')
-rw-r--r--test/diagnostics/unused-function.lua48
1 files changed, 48 insertions, 0 deletions
diff --git a/test/diagnostics/unused-function.lua b/test/diagnostics/unused-function.lua
new file mode 100644
index 00000000..c2cea23a
--- /dev/null
+++ b/test/diagnostics/unused-function.lua
@@ -0,0 +1,48 @@
+TEST [[
+local <!function x()
+end!>
+]]
+
+TEST [[
+local x = <!function () end!>
+]]
+
+TEST [[
+local x
+x = <!function () end!>
+]]
+
+TEST [[
+local <!function x()
+end!>
+local <!function y()
+ x()
+end!>
+]]
+
+TEST [[
+local f = <!function () end!>
+]]
+
+TEST [[
+local f;f = <!function () end!>
+]]
+
+TEST [[
+local <!function f() end!>
+]]
+
+TEST [[
+local <!function f()
+ f()
+end!>
+]]
+
+
+TEST [[
+local <!function test()
+end!>
+
+local <!function foo ()
+end!>
+]]