summaryrefslogtreecommitdiff
path: root/src/pkg/json/scanner_test.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2010-04-21 16:40:53 -0700
committerRuss Cox <rsc@golang.org>2010-04-21 16:40:53 -0700
commitb5c7ab099f6f6712a4f95da09d71d0ab378f6431 (patch)
tree658ed98c6804a2d8e11b7ea023ac07d7820299ae /src/pkg/json/scanner_test.go
parent857111428bbbeef6a845399f49c9f113db6bbfde (diff)
downloadgolang-b5c7ab099f6f6712a4f95da09d71d0ab378f6431.tar.gz
json: Marshal, Unmarshal using new scanner
R=r CC=golang-dev http://codereview.appspot.com/953041
Diffstat (limited to 'src/pkg/json/scanner_test.go')
-rw-r--r--src/pkg/json/scanner_test.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/pkg/json/scanner_test.go b/src/pkg/json/scanner_test.go
index 592960482..cdc032263 100644
--- a/src/pkg/json/scanner_test.go
+++ b/src/pkg/json/scanner_test.go
@@ -175,6 +175,7 @@ func diff(t *testing.T, a, b []byte) {
j = 0
}
t.Errorf("diverge at %d: «%s» vs «%s»", i, trim(a[j:]), trim(b[j:]))
+ return
}
}
}
@@ -191,9 +192,11 @@ func trim(b []byte) []byte {
var jsonBig []byte
func init() {
- var buf bytes.Buffer
- Marshal(&buf, genValue(100000))
- jsonBig = buf.Bytes()
+ b, err := Marshal(genValue(10000))
+ if err != nil {
+ panic(err)
+ }
+ jsonBig = b
}
func genValue(n int) interface{} {