X-Git-Url: https://git.r.bdr.sh/rbdr/mobius/blobdiff_plain/4eae11a5698d60bc51d608713088c546cff3c1ba..c697d13aac49ede1258762b4cf41d9bdcabb4b27:/hotline/transaction_handlers_test.go?ds=sidebyside diff --git a/hotline/transaction_handlers_test.go b/hotline/transaction_handlers_test.go index 21643bf..7c5ee43 100644 --- a/hotline/transaction_handlers_test.go +++ b/hotline/transaction_handlers_test.go @@ -5,7 +5,6 @@ import ( "io/fs" "math/rand" "os" - "reflect" "testing" ) @@ -227,6 +226,21 @@ func TestHandleGetUserNameList(t *testing.T) { Icon: &[]byte{0, 2}, Flags: &[]byte{0, 3}, UserName: []byte{0, 4}, + Agreed: true, + }, + uint16(2): { + ID: &[]byte{0, 2}, + Icon: &[]byte{0, 2}, + Flags: &[]byte{0, 3}, + UserName: []byte{0, 4}, + Agreed: true, + }, + uint16(3): { + ID: &[]byte{0, 3}, + Icon: &[]byte{0, 2}, + Flags: &[]byte{0, 3}, + UserName: []byte{0, 4}, + Agreed: false, }, }, }, @@ -249,6 +263,10 @@ func TestHandleGetUserNameList(t *testing.T) { fieldUsernameWithInfo, []byte{00, 01, 00, 02, 00, 03, 00, 02, 00, 04}, ), + NewField( + fieldUsernameWithInfo, + []byte{00, 02, 00, 02, 00, 03, 00, 02, 00, 04}, + ), }, }, }, @@ -262,9 +280,7 @@ func TestHandleGetUserNameList(t *testing.T) { t.Errorf("HandleGetUserNameList() error = %v, wantErr %v", err, tt.wantErr) return } - if !reflect.DeepEqual(got, tt.want) { - t.Errorf("HandleGetUserNameList() got = %v, want %v", got, tt.want) - } + assert.Equal(t, tt.want, got) }) } }