]> git.r.bdr.sh - rbdr/mobius/blobdiff - hotline/tracker_test.go
Fix io.Reader implementation for FileNameWithInfo
[rbdr/mobius] / hotline / tracker_test.go
index 481f916a9b045daa284df70a41266f1d04674b55..b5c5c557226d002b6706929fc669a2b057673d2c 100644 (file)
@@ -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)
                        }
                })