@@ -72,6 +72,7 @@ func TestSource(t *testing.T) {
72
72
}
73
73
74
74
// Test cases that are expected to fail are marked by the prefix "ERROR".
75
+ // The formatted result must look the same as the input for successful tests.
75
76
var tests = []string {
76
77
// declaration lists
77
78
`import "go/format"` ,
@@ -91,11 +92,23 @@ var tests = []string{
91
92
"\n \t \t \n \n \t \t \t x := 0\n \t \t \t const s = `\n \t \t foo\n `\n \n \n " , // no indentation removed inside raw strings
92
93
93
94
// comments
94
- "i := 5 /* Comment */" , // Issue 5551.
95
- "\t a()\n //line :1" , // Issue 11276.
96
- "\t //xxx\n \t a()\n //line :2" , // Issue 11276.
97
- "\t a() //line :1\n \t b()\n " , // Issue 11276.
98
- "x := 0\n //line :1\n //line :2" , // Issue 11276.
95
+ "/* Comment */" ,
96
+ "\t /* Comment */ " ,
97
+ "\n /* Comment */ " ,
98
+ "i := 5 /* Comment */" , // issue #5551
99
+ "\t a()\n //line :1" , // issue #11276
100
+ "\t //xxx\n \t a()\n //line :2" , // issue #11276
101
+ "\t a() //line :1\n \t b()\n " , // issue #11276
102
+ "x := 0\n //line :1\n //line :2" , // issue #11276
103
+
104
+ // whitespace
105
+ "" , // issue #11275
106
+ " " , // issue #11275
107
+ "\t " , // issue #11275
108
+ "\t \t " , // issue #11275
109
+ "\n " , // issue #11275
110
+ "\n \n " , // issue #11275
111
+ "\t \n " , // issue #11275
99
112
100
113
// erroneous programs
101
114
"ERROR1 + 2 +" ,
0 commit comments