mirror of
https://github.com/golang/go
synced 2024-11-22 22:40:02 -07:00
encoding/binary : add missing test helper calls
Various functions in binary_test.go were missing some t.Helper() calls, so this adds them in.
This commit is contained in:
parent
8f5c6904b6
commit
b28c9255b3
@ -115,6 +115,7 @@ var res = []int32{0x01020304, 0x05060708}
|
||||
var putbuf = []byte{0, 0, 0, 0, 0, 0, 0, 0}
|
||||
|
||||
func checkResult(t *testing.T, dir string, order ByteOrder, err error, have, want any) {
|
||||
t.Helper()
|
||||
if err != nil {
|
||||
t.Errorf("%v %v: %v", dir, order, err)
|
||||
return
|
||||
@ -183,6 +184,7 @@ var decoders = []struct {
|
||||
}
|
||||
|
||||
func testRead(t *testing.T, order ByteOrder, b []byte, s1 any) {
|
||||
t.Helper()
|
||||
for _, dec := range decoders {
|
||||
t.Run(dec.name, func(t *testing.T) {
|
||||
var s2 Struct
|
||||
@ -193,6 +195,7 @@ func testRead(t *testing.T, order ByteOrder, b []byte, s1 any) {
|
||||
}
|
||||
|
||||
func testWrite(t *testing.T, order ByteOrder, b []byte, s1 any) {
|
||||
t.Helper()
|
||||
for _, enc := range encoders {
|
||||
t.Run(enc.name, func(t *testing.T) {
|
||||
buf, err := enc.fn(order, s1)
|
||||
|
Loading…
Reference in New Issue
Block a user