X-Git-Url: https://git.r.bdr.sh/rbdr/mobius/blobdiff_plain/aeb97482e923b5c441dd59e3ca4a7e275ac2b4c2..1c7401b16230f9834469127945d9c506919bed14:/hotline/transaction_handlers_test.go?ds=sidebyside diff --git a/hotline/transaction_handlers_test.go b/hotline/transaction_handlers_test.go index ff1a53c..89ee9fc 100644 --- a/hotline/transaction_handlers_test.go +++ b/hotline/transaction_handlers_test.go @@ -1405,7 +1405,7 @@ func TestHandleGetUser(t *testing.T) { ErrorCode: []byte{0, 0, 0, 0}, Fields: []Field{ NewField(FieldUserName, []byte("Guest")), - NewField(FieldUserLogin, negateString([]byte("guest"))), + NewField(FieldUserLogin, encodeString([]byte("guest"))), NewField(FieldUserPassword, []byte("password")), NewField(FieldUserAccess, []byte{0, 0, 0, 0, 0, 0, 0, 0}), }, @@ -1533,7 +1533,7 @@ func TestHandleDeleteUser(t *testing.T) { }, t: NewTransaction( TranDeleteUser, &[]byte{0, 1}, - NewField(FieldUserLogin, negateString([]byte("testuser"))), + NewField(FieldUserLogin, encodeString([]byte("testuser"))), ), }, wantRes: []Transaction{ @@ -1564,7 +1564,7 @@ func TestHandleDeleteUser(t *testing.T) { }, t: NewTransaction( TranDeleteUser, &[]byte{0, 1}, - NewField(FieldUserLogin, negateString([]byte("testuser"))), + NewField(FieldUserLogin, encodeString([]byte("testuser"))), ), }, wantRes: []Transaction{ @@ -2438,7 +2438,7 @@ func TestHandleSendInstantMsg(t *testing.T) { }, }, }, - wantErr: assert.NoError, + wantErr: assert.Error, }, { name: "when client 1 sends a message to client 2", @@ -2980,7 +2980,7 @@ func TestHandleGetClientInfoText(t *testing.T) { ErrorCode: []byte{0, 0, 0, 0}, Fields: []Field{ NewField(FieldData, []byte( - strings.Replace(`Nickname: Testy McTest + strings.ReplaceAll(`Nickname: Testy McTest Name: test Account: test Address: 1.2.3.4:12345 @@ -3005,7 +3005,7 @@ None. None. -`, "\n", "\r", -1)), +`, "\n", "\r")), ), NewField(FieldUserName, []byte("Testy McTest")), },