Subject: [PATCH v3 29/35] userdiff tests: test for a bug in 1dbf0c0ad6c

From: Ævar Arnfjörð Bjarmason <[email-masked]>
Date: Wed, 24 Feb 2021 20:51:23 +0100

Add a test for a bug in 1dbf0c0ad6c (userdiff: add built-in pattern
for golang, 2018-03-01), we'd ignore everything after the "{" only for
"type" lines, but not "func".

Signed-off-by: Ævar Arnfjörð Bjarmason <[email-masked]>
---
 t/t4018/golang | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/t/t4018/golang b/t/t4018/golang
index 000e66b1c7b..70bf0d936bb 100644
--- a/t/t4018/golang
+++ b/t/t4018/golang
@@ -16,6 +16,13 @@ func RIGHT() {
 	b := ChangeMe
 }
 
+t4018 description: func with comment after {
+t4018 header: func name() { // comment
+func name() { // comment
+	a := 5
+	b := ChangeMe
+}
+
 t4018 description: interface
 t4018 header: type RIGHT interface {
 type RIGHT interface {
@@ -37,3 +44,10 @@ type RIGHT struct {
 	a Type
 	b ChangeMe
 }
+
+t4018 description: struct with comment after {
+t4018 header: type some struct {
+type some struct { // comment
+	a Type
+	b ChangeMe
+}
-- 
2.30.0.284.gd98b1dd5eaa7