summaryrefslogtreecommitdiff
path: root/src/pkg/go/scanner/scanner_test.go
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2009-12-15 08:41:50 -0800
committerRobert Griesemer <gri@golang.org>2009-12-15 08:41:50 -0800
commit38090ac2265961d868eefa40f50449ab3402ef08 (patch)
tree0e243896dcff397aa7e768b97d404a117a27d015 /src/pkg/go/scanner/scanner_test.go
parent16d1981a3e7ca222fb337092cc7d1cb54675268d (diff)
downloadgolang-38090ac2265961d868eefa40f50449ab3402ef08.tar.gz
fix TODO: insert semicolons before any sequence of comments
that introduce the newline (important for correct placement of comments with gofmt when parsing new syntax) R=rsc http://codereview.appspot.com/179055
Diffstat (limited to 'src/pkg/go/scanner/scanner_test.go')
-rw-r--r--src/pkg/go/scanner/scanner_test.go14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/pkg/go/scanner/scanner_test.go b/src/pkg/go/scanner/scanner_test.go
index ddaaab27f..b6d7e99ca 100644
--- a/src/pkg/go/scanner/scanner_test.go
+++ b/src/pkg/go/scanner/scanner_test.go
@@ -284,6 +284,7 @@ func checkSemi(t *testing.T, line string, mode uint) {
var lines = []string{
// the $ character indicates where a semicolon is expected
"",
+ "$;",
"foo$\n",
"123$\n",
"1.2$\n",
@@ -380,16 +381,17 @@ var lines = []string{
"foo$//comment\n",
"foo$/*comment*/\n",
"foo$/*\n*/",
+ "foo$/*comment*/ \n",
+ "foo$/*\n*/ ",
"foo $// comment\n",
"foo $/*comment*/\n",
"foo $/*\n*/",
- // TODO(gri): These need to insert the semicolon *before* the
- // first comment which requires arbitrary far look-
- // ahead. Only relevant for gofmt placement of
- // comments.
- "foo /*comment*/ $\n",
- "foo /*0*/ /*1*/ $/*2*/\n",
+ "foo $/*comment*/\n",
+ "foo $/*0*/ /*1*/ /*2*/\n",
+ "foo $/*comment*/ \n",
+ "foo $/*0*/ /*1*/ /*2*/ \n",
+ "foo $/**/ /*-------------*/ /*----\n*/bar $/* \n*/baa",
}