diff options
| author | Tomas Sandven <tomas@sandven.email> | 2022-04-07 10:39:46 +0200 |
|---|---|---|
| committer | Amaan Qureshi <amaanq12@gmail.com> | 2023-02-24 16:39:33 -0500 |
| commit | 06e8a91ce2aac663023d40cf57965ffade72c792 (patch) | |
| tree | afdf45b4e6a9fed2c52bc6a90a27d5ea66bae622 /tests/indent/yang_spec.lua | |
| parent | feat(health): sort parser list for clarity (diff) | |
| download | nvim-treesitter-06e8a91ce2aac663023d40cf57965ffade72c792.tar nvim-treesitter-06e8a91ce2aac663023d40cf57965ffade72c792.tar.gz nvim-treesitter-06e8a91ce2aac663023d40cf57965ffade72c792.tar.bz2 nvim-treesitter-06e8a91ce2aac663023d40cf57965ffade72c792.tar.lz nvim-treesitter-06e8a91ce2aac663023d40cf57965ffade72c792.tar.xz nvim-treesitter-06e8a91ce2aac663023d40cf57965ffade72c792.tar.zst nvim-treesitter-06e8a91ce2aac663023d40cf57965ffade72c792.zip | |
Add YANG indentation tests
Diffstat (limited to 'tests/indent/yang_spec.lua')
| -rw-r--r-- | tests/indent/yang_spec.lua | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/indent/yang_spec.lua b/tests/indent/yang_spec.lua new file mode 100644 index 000000000..c5ff2c886 --- /dev/null +++ b/tests/indent/yang_spec.lua @@ -0,0 +1,23 @@ +local Runner = require("tests.indent.common").Runner + +local run = Runner:new(it, "tests/indent/yang", { + tabstop = 2, + shiftwidth = 2, + softtabstop = 0, + expandtab = true, +}) + +describe("indent YANG:", function() + describe("whole file:", function() + run:whole_file(".", { + expected_failures = {}, + }) + end) + + describe("new line:", function() + run:new_line("module.yang", { on_line = 12, text = "# Aligned indentation ended", indent = 2 }) + run:new_line("module.yang", { on_line = 37, text = "# Test", indent = 2 }) + run:new_line("module.yang", { on_line = 40, text = "# Test", indent = 4 }) + run:new_line("module.yang", { on_line = 52, text = "Aligned string!", indent = 4 }) + end) +end) |
