aboutsummaryrefslogtreecommitdiffstats
path: root/tests/indent/capnp_spec.lua
diff options
context:
space:
mode:
authorAmaan Qureshi <amaanq12@gmail.com>2023-05-06 11:12:49 -0400
committerGitHub <noreply@github.com>2023-05-07 00:12:49 +0900
commit12453e0e3d2e82a4ae813f1540315c7cf2df2363 (patch)
tree8f7a425d64891b804c8baacbbd7b53c78130d8a8 /tests/indent/capnp_spec.lua
parentUpdate parsers: haskell, vim, vimdoc (diff)
downloadnvim-treesitter-12453e0e3d2e82a4ae813f1540315c7cf2df2363.tar
nvim-treesitter-12453e0e3d2e82a4ae813f1540315c7cf2df2363.tar.gz
nvim-treesitter-12453e0e3d2e82a4ae813f1540315c7cf2df2363.tar.bz2
nvim-treesitter-12453e0e3d2e82a4ae813f1540315c7cf2df2363.tar.lz
nvim-treesitter-12453e0e3d2e82a4ae813f1540315c7cf2df2363.tar.xz
nvim-treesitter-12453e0e3d2e82a4ae813f1540315c7cf2df2363.tar.zst
nvim-treesitter-12453e0e3d2e82a4ae813f1540315c7cf2df2363.zip
Update Capnp (#4713)
* feat(capnp): update queries from upstream changes * test: add tests for capnp * fix indent queries * ci: fix capnp indent tests --------- Co-authored-by: Pham Huy Hoang <hoangtun0810@gmail.com>
Diffstat (limited to 'tests/indent/capnp_spec.lua')
-rw-r--r--tests/indent/capnp_spec.lua30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/indent/capnp_spec.lua b/tests/indent/capnp_spec.lua
new file mode 100644
index 000000000..7c8418b06
--- /dev/null
+++ b/tests/indent/capnp_spec.lua
@@ -0,0 +1,30 @@
+local Runner = require("tests.indent.common").Runner
+
+local run = Runner:new(it, "tests/indent/capnp", {
+ tabstop = 2,
+ shiftwidth = 2,
+ expandtab = true,
+})
+
+describe("indent Cap'n Proto:", function()
+ describe("whole file:", function()
+ run:whole_file(".", {
+ expected_failures = {},
+ })
+ end)
+
+ describe("new line:", function()
+ run:new_line("test.capnp", { on_line = 31, text = "foo @0;", indent = 2 })
+ run:new_line("test.capnp", { on_line = 96, text = "boolField = true,", indent = 4 })
+ run:new_line("test.capnp", { on_line = 340, text = "grault @7 :UInt64;", indent = 8 })
+ run:new_line("test.capnp", {
+ on_line = 573,
+ text = "call @0 Inner2(Text) -> (qux :Qux, gen :TestGenerics(TestAllTypes, TestAnyPointer));",
+ indent = 4,
+ })
+ run:new_line("test.capnp", { on_line = 617, text = "foo @0 :Foo;", indent = 4 })
+ run:new_line("test.capnp", { on_line = 654, text = "foo = (int16Field = 123),", indent = 4 })
+ run:new_line("test.capnp", { on_line = 695, text = 'textField = "nested",', indent = 6 })
+ run:new_line("test.capnp", { on_line = 970, text = "testTailCaller @4;", indent = 4 })
+ end)
+end)