diff options
| author | Stephan Seitz <stephan.seitz@fau.de> | 2022-01-25 22:19:10 +0100 |
|---|---|---|
| committer | Stephan Seitz <stephan.seitz@fau.de> | 2022-02-05 18:54:55 +0100 |
| commit | 5d954f1812222eecc191d1a2f6dbd7f72aa19780 (patch) | |
| tree | e90a181e483e45f67c1e16c857564dc0326c7f78 | |
| parent | indents(go): remove `function_declaration` from indents (diff) | |
| download | nvim-treesitter-5d954f1812222eecc191d1a2f6dbd7f72aa19780.tar nvim-treesitter-5d954f1812222eecc191d1a2f6dbd7f72aa19780.tar.gz nvim-treesitter-5d954f1812222eecc191d1a2f6dbd7f72aa19780.tar.bz2 nvim-treesitter-5d954f1812222eecc191d1a2f6dbd7f72aa19780.tar.lz nvim-treesitter-5d954f1812222eecc191d1a2f6dbd7f72aa19780.tar.xz nvim-treesitter-5d954f1812222eecc191d1a2f6dbd7f72aa19780.tar.zst nvim-treesitter-5d954f1812222eecc191d1a2f6dbd7f72aa19780.zip | |
indents(go): add tests
| -rw-r--r-- | tests/indent/go/issue-2369.go | 14 | ||||
| -rw-r--r-- | tests/indent/go_spec.lua | 21 |
2 files changed, 35 insertions, 0 deletions
diff --git a/tests/indent/go/issue-2369.go b/tests/indent/go/issue-2369.go new file mode 100644 index 000000000..a4d29a307 --- /dev/null +++ b/tests/indent/go/issue-2369.go @@ -0,0 +1,14 @@ +// https://github.com/nvim-treesitter/nvim-treesitter/issues/2369 +package main + +import "fmt" + +func goodIndent(param string) { + fmt.Println("typing o here works as expected") +} + +func badIndent( + param string, // this is the difference +) { + fmt.Println("typing o here triggers bad indent") +} diff --git a/tests/indent/go_spec.lua b/tests/indent/go_spec.lua new file mode 100644 index 000000000..3ae844e71 --- /dev/null +++ b/tests/indent/go_spec.lua @@ -0,0 +1,21 @@ +local Runner = require("tests.indent.common").Runner +--local XFAIL = require("tests.indent.common").XFAIL + +local run = Runner:new(it, "tests/indent/go", { + tabstop = 4, + shiftwidth = 4, + softtabstop = 4, + expandtab = false, +}) + +describe("indent Python:", function() + describe("whole file:", function() + run:whole_file(".", { + expected_failures = {}, + }) + end) + + describe("new line:", function() + run:new_line("issue-2369.go", { on_line = 13, text = "// some comment", indent = 1 }) + end) +end) |
