From 63a88c873f3643aad9208488765dc53618edd40e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Boczar?= Date: Thu, 22 Apr 2021 20:53:30 +0200 Subject: move all tests to top-level tests/ directory --- tests/indent/lua/comment.lua | 7 +++++++ tests/indent/lua/cond.lua | 12 ++++++++++++ tests/indent/lua/func.lua | 9 +++++++++ tests/indent/lua/loop.lua | 14 ++++++++++++++ tests/indent/lua/string.lua | 5 +++++ tests/indent/lua/table.lua | 10 ++++++++++ 6 files changed, 57 insertions(+) create mode 100644 tests/indent/lua/comment.lua create mode 100644 tests/indent/lua/cond.lua create mode 100644 tests/indent/lua/func.lua create mode 100644 tests/indent/lua/loop.lua create mode 100644 tests/indent/lua/string.lua create mode 100644 tests/indent/lua/table.lua (limited to 'tests/indent/lua') diff --git a/tests/indent/lua/comment.lua b/tests/indent/lua/comment.lua new file mode 100644 index 00000000..9f3624e1 --- /dev/null +++ b/tests/indent/lua/comment.lua @@ -0,0 +1,7 @@ +-- some +-- comment + +--[[ + another + comment +--]] diff --git a/tests/indent/lua/cond.lua b/tests/indent/lua/cond.lua new file mode 100644 index 00000000..dfae37f0 --- /dev/null +++ b/tests/indent/lua/cond.lua @@ -0,0 +1,12 @@ +local x = 10 + +if x > 3 then + x = 3 +elseif x < 3 then + x = -3 +else + if x > 0 then + x = 1 + end + x = 0 +end diff --git a/tests/indent/lua/func.lua b/tests/indent/lua/func.lua new file mode 100644 index 00000000..1f95ca97 --- /dev/null +++ b/tests/indent/lua/func.lua @@ -0,0 +1,9 @@ +function foo(x) + local bar = function(a, b, c) + return a + b + c + end + return bar( + x, + 1, + 2) +end diff --git a/tests/indent/lua/loop.lua b/tests/indent/lua/loop.lua new file mode 100644 index 00000000..7f5402d1 --- /dev/null +++ b/tests/indent/lua/loop.lua @@ -0,0 +1,14 @@ +local x = 1 + +while x < 10 do + x = x + 1 + break +end + +for i = 1,3 do + x = x + i +end + +repeat + x = x + 1 +until x > 100 diff --git a/tests/indent/lua/string.lua b/tests/indent/lua/string.lua new file mode 100644 index 00000000..adfebf76 --- /dev/null +++ b/tests/indent/lua/string.lua @@ -0,0 +1,5 @@ +local s = [[ +a + multiline + string +]] diff --git a/tests/indent/lua/table.lua b/tests/indent/lua/table.lua new file mode 100644 index 00000000..d53504b4 --- /dev/null +++ b/tests/indent/lua/table.lua @@ -0,0 +1,10 @@ +local a = { + x = 1, + y = 2, + z = { + 1, 2, 3, + }, + ['hello world'] = { + 1, 2, 3 + } +} -- cgit v1.2.3