aboutsummaryrefslogtreecommitdiff
path: root/src/go/printer/testdata/comments.input
diff options
context:
space:
mode:
Diffstat (limited to 'src/go/printer/testdata/comments.input')
-rw-r--r--src/go/printer/testdata/comments.input18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/go/printer/testdata/comments.input b/src/go/printer/testdata/comments.input
index 30cd23c6dd..40351eeef6 100644
--- a/src/go/printer/testdata/comments.input
+++ b/src/go/printer/testdata/comments.input
@@ -607,6 +607,24 @@ func _() {
_ = a
}
+// Test cases from issues 11274, 15137:
+// Semicolon must not be lost when multiple statements are on the same line with a comment.
+func _() {
+ x := 0 /**/; y := 1
+}
+
+func _() {
+ f(); f()
+ f(); /* comment */ f()
+ f() /* comment */; f()
+ f(); /* a */ /* b */ f()
+ f() /* a */ /* b */; f()
+ f() /* a */; /* b */ f()
+}
+
+func _() {
+ f() /* a */ /* b */ }
+
// Comments immediately adjacent to punctuation followed by a newline
// remain after the punctuation (looks better and permits alignment of
// comments).