diff options
Diffstat (limited to 'src/pkg/go/printer/testdata/statements.golden')
-rw-r--r-- | src/pkg/go/printer/testdata/statements.golden | 81 |
1 files changed, 80 insertions, 1 deletions
diff --git a/src/pkg/go/printer/testdata/statements.golden b/src/pkg/go/printer/testdata/statements.golden index 73a3e1236..5eceb7dd5 100644 --- a/src/pkg/go/printer/testdata/statements.golden +++ b/src/pkg/go/printer/testdata/statements.golden @@ -209,6 +209,38 @@ func _() { for _ = range (T1{T{42}}) { } + + if x == (T{42}[0]) { + } + if (x == T{42}[0]) { + } + if x == (T{42}[0]) { + } + if x == (T{42}[0]) { + } + if x == (T{42}[0]) { + } + if x == a+b*(T{42}[0]) { + } + if (x == a+b*T{42}[0]) { + } + if x == a+b*(T{42}[0]) { + } + if x == a+(b * (T{42}[0])) { + } + if x == a+b*(T{42}[0]) { + } + if (a + b*(T{42}[0])) == x { + } + if (a + b*(T{42}[0])) == x { + } + + if struct{ x bool }{false}.x { + } + if (struct{ x bool }{false}.x) == false { + } + if struct{ x bool }{false}.x == false { + } } @@ -227,7 +259,8 @@ func _() { var x = 1 // Each use(x) call below should have at most one empty line before and after. - + // Known bug: The first use call may have more than one empty line before + // (see go/printer/nodes.go, func linebreak). use(x) @@ -336,3 +369,49 @@ AnOverlongLabel: L: _ = 0 } + + +func _() { + for { + goto L + } +L: + + MoreCode() +} + + +func _() { + for { + goto L + } +L: // A comment on the same line as the label, followed by a single empty line. + // Known bug: There may be more than one empty line before MoreCode() + // (see go/printer/nodes.go, func linebreak). + + + MoreCode() +} + + +func _() { + for { + goto L + } +L: + + // There should be a single empty line before this comment. + MoreCode() +} + + +func _() { + for { + goto AVeryLongLabelThatShouldNotAffectFormatting + } +AVeryLongLabelThatShouldNotAffectFormatting: + // There should be a single empty line after this comment. + + // There should be a single empty line before this comment. + MoreCode() +} |