summaryrefslogtreecommitdiff
path: root/src/pkg/go/ast/print_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/go/ast/print_test.go')
-rw-r--r--src/pkg/go/ast/print_test.go17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/pkg/go/ast/print_test.go b/src/pkg/go/ast/print_test.go
index f4e8f7a78..71c028e75 100644
--- a/src/pkg/go/ast/print_test.go
+++ b/src/pkg/go/ast/print_test.go
@@ -23,11 +23,10 @@ var tests = []struct {
{"foobar", "0 \"foobar\""},
// maps
- {map[string]int{"a": 1, "b": 2},
- `0 map[string] int (len = 2) {
+ {map[string]int{"a": 1},
+ `0 map[string]int (len = 1) {
1 . "a": 1
- 2 . "b": 2
- 3 }`},
+ 2 }`},
// pointers
{new(int), "0 *0"},
@@ -41,10 +40,10 @@ var tests = []struct {
4 }`},
// structs
- {struct{ x, y int }{42, 991},
- `0 struct { x int; y int } {
- 1 . x: 42
- 2 . y: 991
+ {struct{ X, Y int }{42, 991},
+ `0 struct { X int; Y int } {
+ 1 . X: 42
+ 2 . Y: 991
3 }`},
}
@@ -67,7 +66,7 @@ func TestPrint(t *testing.T) {
var buf bytes.Buffer
for _, test := range tests {
buf.Reset()
- if _, err := Fprint(&buf, nil, test.x, nil); err != nil {
+ if err := Fprint(&buf, nil, test.x, nil); err != nil {
t.Errorf("Fprint failed: %s", err)
}
if s, ts := trim(buf.String()), trim(test.s); s != ts {