From bca65c068b92f19174dbba15d538315e8c89a5d6 Mon Sep 17 00:00:00 2001 From: Akin Sowemimo Date: Mon, 18 Apr 2022 12:19:31 +0100 Subject: test(go): add cases for newlines de-indentation test(go): combine new indent test cases test(go): add incorrect indent after var closing ) this case does not work correctly already so add that in since this PR does not address that case test(go): set current lines in indent test test(go): simplify test case --- tests/indent/go/issue-2369-newline.go | 8 ++++++++ tests/indent/go_spec.lua | 4 ++++ 2 files changed, 12 insertions(+) create mode 100644 tests/indent/go/issue-2369-newline.go diff --git a/tests/indent/go/issue-2369-newline.go b/tests/indent/go/issue-2369-newline.go new file mode 100644 index 00000000..42dd00b5 --- /dev/null +++ b/tests/indent/go/issue-2369-newline.go @@ -0,0 +1,8 @@ +// https://github.com/nvim-treesitter/nvim-treesitter/issues/2369 +package main + +import "fmt" + +func new_line() { + fmt.Println("Hello, World!") +} diff --git a/tests/indent/go_spec.lua b/tests/indent/go_spec.lua index 25c19337..10e9763c 100644 --- a/tests/indent/go_spec.lua +++ b/tests/indent/go_spec.lua @@ -18,4 +18,8 @@ describe("indent Go:", function() describe("new line:", function() run:new_line("issue-2369.go", { on_line = 13, text = "// some comment", indent = 1 }) end) + + describe("new line after )/}:", function() + run:new_line("issue-2369-newline.go", { on_line = 8, text = "// comment", indent = 0 }) + end) end) -- cgit v1.2.3