diff options
| author | Rob Pike <r@golang.org> | 2011-12-20 10:36:25 -0800 |
|---|---|---|
| committer | Rob Pike <r@golang.org> | 2011-12-20 10:36:25 -0800 |
| commit | 6b772462e420d15f5e1669a5f03e4f1cb7d8f2af (patch) | |
| tree | 6c54dc3455a36f21f5d12f9d3e8ea170cb7562db /src/pkg/encoding/binary | |
| parent | b9697d4a58bfd6dd99e03123c3d53e4f1b035787 (diff) | |
| download | go-6b772462e420d15f5e1669a5f03e4f1cb7d8f2af.tar.xz | |
panics: use the new facilities of testing.B instead
Lots of panics go away.
Also fix a name error in html/template.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5498045
Diffstat (limited to 'src/pkg/encoding/binary')
| -rw-r--r-- | src/pkg/encoding/binary/binary_test.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pkg/encoding/binary/binary_test.go b/src/pkg/encoding/binary/binary_test.go index 899505e0a5..3e7057ea22 100644 --- a/src/pkg/encoding/binary/binary_test.go +++ b/src/pkg/encoding/binary/binary_test.go @@ -197,7 +197,7 @@ func BenchmarkReadStruct(b *testing.B) { } b.StopTimer() if !reflect.DeepEqual(s, t) { - panic("no match") + b.Fatal("no match") } } @@ -251,6 +251,6 @@ func BenchmarkWriteInts(b *testing.B) { } b.StopTimer() if !bytes.Equal(buf.Bytes(), big[:30]) { - panic("first half doesn't match") + b.Fatalf("first half doesn't match: %x %x", buf.Bytes(), big[:30]) } } |
