diff options
| author | Jeff Halter <868228+jhalter@users.noreply.github.com> | 2024-06-08 19:25:12 -0700 |
|---|---|---|
| committer | Jeff Halter <868228+jhalter@users.noreply.github.com> | 2024-06-09 14:05:15 -0700 |
| commit | 9a75b7cbfa6fa37ed10732bbff8b722d652a1cdc (patch) | |
| tree | 1975296aa334a4e5d074162e101c73358293b784 /hotline/tracker_test.go | |
| parent | 2b7fabb5a1ff6092dd3ea62bd882dd0c02951b81 (diff) | |
Refactor TrackerRegistration Read to io.Reader interface
Diffstat (limited to 'hotline/tracker_test.go')
| -rw-r--r-- | hotline/tracker_test.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/hotline/tracker_test.go b/hotline/tracker_test.go index 481f916..b5c5c55 100644 --- a/hotline/tracker_test.go +++ b/hotline/tracker_test.go @@ -3,6 +3,7 @@ package hotline import ( "fmt" "github.com/stretchr/testify/assert" + "io" "reflect" "testing" ) @@ -11,7 +12,7 @@ func TestTrackerRegistration_Payload(t *testing.T) { type fields struct { Port [2]byte UserCount int - PassID []byte + PassID [4]byte Name string Description string } @@ -25,7 +26,7 @@ func TestTrackerRegistration_Payload(t *testing.T) { 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", }, @@ -51,7 +52,8 @@ func TestTrackerRegistration_Payload(t *testing.T) { 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) } }) |