diff options
| author | Riley Bruins <ribru17@hotmail.com> | 2024-03-31 09:20:18 -0700 |
|---|---|---|
| committer | Christian Clason <c.clason@uni-graz.at> | 2024-07-05 15:13:25 +0200 |
| commit | 55a13862cd47b1fb3afcab792b022d97765940e6 (patch) | |
| tree | edc82fcabbd90bafcd994c0a419e0f6880207086 /tests/indent/nix_spec.lua | |
| parent | bot(lockfile): update editorconfig, javascript, wit (diff) | |
| download | nvim-treesitter-55a13862cd47b1fb3afcab792b022d97765940e6.tar nvim-treesitter-55a13862cd47b1fb3afcab792b022d97765940e6.tar.gz nvim-treesitter-55a13862cd47b1fb3afcab792b022d97765940e6.tar.bz2 nvim-treesitter-55a13862cd47b1fb3afcab792b022d97765940e6.tar.lz nvim-treesitter-55a13862cd47b1fb3afcab792b022d97765940e6.tar.xz nvim-treesitter-55a13862cd47b1fb3afcab792b022d97765940e6.tar.zst nvim-treesitter-55a13862cd47b1fb3afcab792b022d97765940e6.zip | |
feat(nix): indentation queries
Diffstat (limited to 'tests/indent/nix_spec.lua')
| -rw-r--r-- | tests/indent/nix_spec.lua | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/tests/indent/nix_spec.lua b/tests/indent/nix_spec.lua new file mode 100644 index 000000000..709a0a109 --- /dev/null +++ b/tests/indent/nix_spec.lua @@ -0,0 +1,40 @@ +local Runner = require("tests.indent.common").Runner + +local runner = Runner:new(it, "tests/indent/nix", { + tabstop = 2, + shiftwidth = 2, + softtabstop = 2, + expandtab = true, +}) + +describe("indent Nix:", function() + describe("whole file:", function() + runner:whole_file(".", { + expected_failures = {}, + }) + end) + + describe("new line:", function() + for _, info in ipairs { + { 14, 2 }, + { 16, 2 }, + { 48, 4 }, + { 112, 6 }, + } do + runner:new_line("general.nix", { on_line = info[1], text = "x = 1;", indent = info[2] }) + end + + for _, info in ipairs { + { 115, 6 }, + { 113, 10 }, + { 6, 4 }, + { 12, 2 }, + { 16, 6 }, + { 35, 6 }, + { 23, 2 }, + { 21, 6 }, + } do + runner:new_line("conds.nix", { on_line = info[1], text = "x = 1;", indent = info[2] }) + end + end) +end) |
