diff options
| author | Jędrzej Boczar <yendreij@gmail.com> | 2021-04-22 20:53:30 +0200 |
|---|---|---|
| committer | Kiyan <yazdani.kiyan@protonmail.com> | 2021-04-23 21:21:38 +0200 |
| commit | 63a88c873f3643aad9208488765dc53618edd40e (patch) | |
| tree | fb233a54b0dae8a6af1a12dfecb9cd85cbdb4f64 /tests/indent/lua | |
| parent | ignore Lua indent test files when doing style-check (diff) | |
| download | nvim-treesitter-63a88c873f3643aad9208488765dc53618edd40e.tar nvim-treesitter-63a88c873f3643aad9208488765dc53618edd40e.tar.gz nvim-treesitter-63a88c873f3643aad9208488765dc53618edd40e.tar.bz2 nvim-treesitter-63a88c873f3643aad9208488765dc53618edd40e.tar.lz nvim-treesitter-63a88c873f3643aad9208488765dc53618edd40e.tar.xz nvim-treesitter-63a88c873f3643aad9208488765dc53618edd40e.tar.zst nvim-treesitter-63a88c873f3643aad9208488765dc53618edd40e.zip | |
move all tests to top-level tests/ directory
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 + } +} |
