diff options
Diffstat (limited to 'tests/indent/lua')
| -rw-r--r-- | tests/indent/lua/comment.lua | 7 | ||||
| -rw-r--r-- | tests/indent/lua/cond.lua | 12 | ||||
| -rw-r--r-- | tests/indent/lua/func.lua | 9 | ||||
| -rw-r--r-- | tests/indent/lua/loop.lua | 14 | ||||
| -rw-r--r-- | tests/indent/lua/string.lua | 5 | ||||
| -rw-r--r-- | tests/indent/lua/table.lua | 10 |
6 files changed, 57 insertions, 0 deletions
diff --git a/tests/indent/lua/comment.lua b/tests/indent/lua/comment.lua new file mode 100644 index 000000000..9f3624e1e --- /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 000000000..dfae37f05 --- /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 000000000..1f95ca97a --- /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 000000000..7f5402d1e --- /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 000000000..adfebf76a --- /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 000000000..d53504b45 --- /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 + } +} |
