import (
"fmt"
"github.com/stretchr/testify/assert"
+ "io"
"reflect"
"testing"
)
type fields struct {
Port [2]byte
UserCount int
- PassID []byte
+ PassID [4]byte
Name string
Description string
}
fields: fields{
Port: [2]byte{0x00, 0x10},
UserCount: 2,
- PassID: []byte{0x00, 0x00, 0x00, 0x01},
+ PassID: [4]byte{0x00, 0x00, 0x00, 0x01},
Name: "Test Serv",
Description: "Fooz",
},
Name: tt.fields.Name,
Description: tt.fields.Description,
}
- if got := tr.Read(); !reflect.DeepEqual(got, tt.want) {
+
+ if got, _ := io.ReadAll(tr); !reflect.DeepEqual(got, tt.want) {
t.Errorf("Read() = %v, want %v", got, tt.want)
}
})