aboutsummaryrefslogtreecommitdiffstats
path: root/tests/indent/meson_spec.lua
diff options
context:
space:
mode:
authorJędrzej Boczar <yendreij@gmail.com>2024-01-19 16:08:23 +0100
committerChristian Clason <c.clason@uni-graz.at>2024-01-20 10:48:56 +0100
commit6548bb64c11e0860a504de3012e8aa14e1d51d7e (patch)
treec6dea405b7af49d5cc56e22aad3b895d64b98bbb /tests/indent/meson_spec.lua
parentFixup format (#5934) (diff)
downloadnvim-treesitter-6548bb64c11e0860a504de3012e8aa14e1d51d7e.tar
nvim-treesitter-6548bb64c11e0860a504de3012e8aa14e1d51d7e.tar.gz
nvim-treesitter-6548bb64c11e0860a504de3012e8aa14e1d51d7e.tar.bz2
nvim-treesitter-6548bb64c11e0860a504de3012e8aa14e1d51d7e.tar.lz
nvim-treesitter-6548bb64c11e0860a504de3012e8aa14e1d51d7e.tar.xz
nvim-treesitter-6548bb64c11e0860a504de3012e8aa14e1d51d7e.tar.zst
nvim-treesitter-6548bb64c11e0860a504de3012e8aa14e1d51d7e.zip
feat(meson): add indents.scm
Diffstat (limited to 'tests/indent/meson_spec.lua')
-rw-r--r--tests/indent/meson_spec.lua28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/indent/meson_spec.lua b/tests/indent/meson_spec.lua
new file mode 100644
index 000000000..bc2372ee0
--- /dev/null
+++ b/tests/indent/meson_spec.lua
@@ -0,0 +1,28 @@
+local Runner = require("tests.indent.common").Runner
+
+local run = Runner:new(it, "tests/indent/meson", {
+ tabstop = 2,
+ shiftwidth = 2,
+ softtabstop = 0,
+ expandtab = true,
+})
+
+describe("indent Meson:", function()
+ describe("whole file:", function()
+ run:whole_file(".", {
+ expected_failures = {},
+ })
+ end)
+
+ describe("new line:", function()
+ run:new_line("cond.meson", { on_line = 3, text = "foo()", indent = 2 })
+ run:new_line("cond.meson", { on_line = 6, text = "foo()", indent = 2 })
+ run:new_line("cond.meson", { on_line = 7, text = "foo()", indent = 2 })
+ run:new_line("cond.meson", { on_line = 12, text = "foo()", indent = 2 })
+ run:new_line("cond.meson", { on_line = 14, text = "foo()", indent = 2 })
+ run:new_line("dict.meson", { on_line = 13, text = ",'x':1,", indent = 2 })
+ run:new_line("loop.meson", { on_line = 3, text = "foo()", indent = 2 })
+ run:new_line("loop.meson", { on_line = 7, text = "foo()", indent = 2 })
+ run:new_line("ternary.meson", { on_line = 11, text = "x : y", indent = 2 })
+ end)
+end)