aboutsummaryrefslogtreecommitdiffstats
path: root/tests/indent
diff options
context:
space:
mode:
authorLuckas <luckasranarison@gmail.com>2024-03-15 03:18:33 +0300
committerGitHub <noreply@github.com>2024-03-15 09:18:33 +0900
commit904f373fc4e6fb474e3df35b57f78edee8e45267 (patch)
treec62ecda47c526d8218d21d68441d490a3d2e78cd /tests/indent
parentfix(vimdoc): adapt to breaking Neovim change (diff)
downloadnvim-treesitter-904f373fc4e6fb474e3df35b57f78edee8e45267.tar
nvim-treesitter-904f373fc4e6fb474e3df35b57f78edee8e45267.tar.gz
nvim-treesitter-904f373fc4e6fb474e3df35b57f78edee8e45267.tar.bz2
nvim-treesitter-904f373fc4e6fb474e3df35b57f78edee8e45267.tar.lz
nvim-treesitter-904f373fc4e6fb474e3df35b57f78edee8e45267.tar.xz
nvim-treesitter-904f373fc4e6fb474e3df35b57f78edee8e45267.tar.zst
nvim-treesitter-904f373fc4e6fb474e3df35b57f78edee8e45267.zip
feat(dot): add indents queries
* feat(dot): add indents queries * add: tests * fix: test
Diffstat (limited to 'tests/indent')
-rw-r--r--tests/indent/dot/test.dot8
-rw-r--r--tests/indent/dot_spec.lua25
2 files changed, 33 insertions, 0 deletions
diff --git a/tests/indent/dot/test.dot b/tests/indent/dot/test.dot
new file mode 100644
index 000000000..b3fe35fca
--- /dev/null
+++ b/tests/indent/dot/test.dot
@@ -0,0 +1,8 @@
+digraph {
+ node [
+ shape=ellipse,
+ ];
+ subgraph sub {
+ a1 -> a2 -> a3;
+ }
+}
diff --git a/tests/indent/dot_spec.lua b/tests/indent/dot_spec.lua
new file mode 100644
index 000000000..ac78f8d92
--- /dev/null
+++ b/tests/indent/dot_spec.lua
@@ -0,0 +1,25 @@
+local Runner = require("tests.indent.common").Runner
+
+local run = Runner:new(it, "tests/indent/dot", {
+ tabstop = 2,
+ shiftwidth = 2,
+ softtabstop = 0,
+ expandtab = true,
+})
+
+describe("indent dot:", function()
+ describe("whole file:", function()
+ run:whole_file(".", {
+ expected_failures = {},
+ })
+ end)
+
+ describe("new line:", function()
+ run:new_line("test.dot", { on_line = 1, text = "node [", indent = 2 })
+ run:new_line("test.dot", { on_line = 2, text = "shape=ellipse,", indent = 4 })
+ run:new_line("test.dot", { on_line = 4, text = "subgraph sub {", indent = 2 })
+ run:new_line("test.dot", { on_line = 5, text = "a1 -> a2 -> a3;", indent = 4 })
+ run:new_line("test.dot", { on_line = 6, text = "}", indent = 2 })
+ run:new_line("test.dot", { on_line = 7, text = "}", indent = 0 })
+ end)
+end)