diff options
author | Michael Stapelberg <stapelberg@debian.org> | 2013-03-04 21:27:36 +0100 |
---|---|---|
committer | Michael Stapelberg <michael@stapelberg.de> | 2013-03-04 21:27:36 +0100 |
commit | 04b08da9af0c450d645ab7389d1467308cfc2db8 (patch) | |
tree | db247935fa4f2f94408edc3acd5d0d4f997aa0d8 /src/pkg/encoding/json/scanner_test.go | |
parent | 917c5fb8ec48e22459d77e3849e6d388f93d3260 (diff) | |
download | golang-upstream/1.1_hg20130304.tar.gz |
Imported Upstream version 1.1~hg20130304upstream/1.1_hg20130304
Diffstat (limited to 'src/pkg/encoding/json/scanner_test.go')
-rw-r--r-- | src/pkg/encoding/json/scanner_test.go | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/pkg/encoding/json/scanner_test.go b/src/pkg/encoding/json/scanner_test.go index 14d850865..77d3455d3 100644 --- a/src/pkg/encoding/json/scanner_test.go +++ b/src/pkg/encoding/json/scanner_test.go @@ -92,7 +92,7 @@ func TestCompactBig(t *testing.T) { t.Fatalf("Compact: %v", err) } b := buf.Bytes() - if bytes.Compare(b, jsonBig) != 0 { + if !bytes.Equal(b, jsonBig) { t.Error("Compact(jsonBig) != jsonBig") diff(t, b, jsonBig) return @@ -118,7 +118,7 @@ func TestIndentBig(t *testing.T) { t.Fatalf("Indent2: %v", err) } b1 := buf1.Bytes() - if bytes.Compare(b1, b) != 0 { + if !bytes.Equal(b1, b) { t.Error("Indent(Indent(jsonBig)) != Indent(jsonBig)") diff(t, b1, b) return @@ -130,7 +130,7 @@ func TestIndentBig(t *testing.T) { t.Fatalf("Compact: %v", err) } b1 = buf1.Bytes() - if bytes.Compare(b1, jsonBig) != 0 { + if !bytes.Equal(b1, jsonBig) { t.Error("Compact(Indent(jsonBig)) != jsonBig") diff(t, b1, jsonBig) return @@ -277,9 +277,6 @@ func genArray(n int) []interface{} { if f > n { f = n } - if n > 0 && f == 0 { - f = 1 - } x := make([]interface{}, f) for i := range x { x[i] = genValue(((i+1)*n)/f - (i*n)/f) |