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 /tests | |
| parent | b7c72e99926cf1f9b3690eaad8b51470b6ebb09a (diff) | |
indents(go): add tests
Diffstat (limited to '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 00000000..a4d29a30 --- /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 00000000..3ae844e7 --- /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) |
