summaryrefslogtreecommitdiff
path: root/src/pkg/go/printer/testdata
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2012-10-30 13:09:47 -0700
committerRobert Griesemer <gri@golang.org>2012-10-30 13:09:47 -0700
commit7e6f83734da825839dd3142c650d8ed902a4623c (patch)
tree244e1126d5c720876b8ca3a9cd23942e20c16a5e /src/pkg/go/printer/testdata
parentde58746461240dc6db30b49c301c0ba7197c7067 (diff)
downloadgo-7e6f83734da825839dd3142c650d8ed902a4623c.tar.gz
go/printer, gofmt: trim trailing whitespace in comments
Also: updated go fix testcases to pass tests. Fixes issue 4310. R=r CC=golang-dev http://codereview.appspot.com/6810055
Diffstat (limited to 'src/pkg/go/printer/testdata')
-rw-r--r--src/pkg/go/printer/testdata/comments.golden11
-rw-r--r--src/pkg/go/printer/testdata/comments.input10
2 files changed, 19 insertions, 2 deletions
diff --git a/src/pkg/go/printer/testdata/comments.golden b/src/pkg/go/printer/testdata/comments.golden
index d9aa2d82f..610a42a68 100644
--- a/src/pkg/go/printer/testdata/comments.golden
+++ b/src/pkg/go/printer/testdata/comments.golden
@@ -529,7 +529,7 @@ func _() {
}
func _() {
- var a = []int{1, 2}// jasldf
+ var a = []int{1, 2}// jasldf
_ = a
}
@@ -626,4 +626,13 @@ func _() {
var lflag bool // -l - disable line directives
}
+// Trailing white space in comments should be trimmed
+func _() {
+ // This comment has 4 blanks following that should be trimmed:
+ /* Each line of this comment has blanks or tabs following that should be trimmed:
+ line 2:
+ line 3:
+ */
+}
+
/* This comment is the last entry in this file. It must be printed and should be followed by a newline */
diff --git a/src/pkg/go/printer/testdata/comments.input b/src/pkg/go/printer/testdata/comments.input
index 6084b3fe4..d121dd4be 100644
--- a/src/pkg/go/printer/testdata/comments.input
+++ b/src/pkg/go/printer/testdata/comments.input
@@ -534,7 +534,7 @@ func _() {
}
func _() {
- var a = []int{1, 2, // jasldf
+ var a = []int{1, 2, // jasldf
}
_ = a
}
@@ -630,5 +630,13 @@ var vflag string // -v [y.output] - y.output file
var lflag bool // -l - disable line directives
}
+// Trailing white space in comments should be trimmed
+func _() {
+// This comment has 4 blanks following that should be trimmed:
+/* Each line of this comment has blanks or tabs following that should be trimmed:
+ line 2:
+ line 3:
+*/
+}
/* This comment is the last entry in this file. It must be printed and should be followed by a newline */