},
},
t: &Transaction{
- Flags: 0x00,
- IsReply: 0x00,
- Type: []byte{0, 0x6a},
- ID: []byte{0, 0, 0, 1},
- ErrorCode: []byte{0, 0, 0, 0},
+ Type: [2]byte{0, 0x6a},
+ ID: [4]byte{0, 0, 0, 1},
Fields: []Field{
NewField(FieldChatID, []byte{0, 0, 0, 1}),
NewField(FieldChatSubject, []byte("Test Subject")),
},
want: []Transaction{
{
- clientID: &[]byte{0, 1},
- Flags: 0x00,
- IsReply: 0x00,
- Type: []byte{0, 0x77},
- ID: []byte{0x9a, 0xcb, 0x04, 0x42}, // Random ID from rand.Seed(1)
- ErrorCode: []byte{0, 0, 0, 0},
+ clientID: &[]byte{0, 1},
+ Type: [2]byte{0, 0x77},
Fields: []Field{
NewField(FieldChatID, []byte{0, 0, 0, 1}),
NewField(FieldChatSubject, []byte("Test Subject")),
},
},
{
- clientID: &[]byte{0, 2},
- Flags: 0x00,
- IsReply: 0x00,
- Type: []byte{0, 0x77},
- ID: []byte{0xf0, 0xc5, 0x34, 0x1e}, // Random ID from rand.Seed(1)
- ErrorCode: []byte{0, 0, 0, 0},
+ clientID: &[]byte{0, 2},
+ Type: [2]byte{0, 0x77},
Fields: []Field{
NewField(FieldChatID, []byte{0, 0, 0, 1}),
NewField(FieldChatSubject, []byte("Test Subject")),
},
want: []Transaction{
{
- clientID: &[]byte{0, 1},
- Flags: 0x00,
- IsReply: 0x00,
- Type: []byte{0, 0x76},
- ID: []byte{0x9a, 0xcb, 0x04, 0x42}, // Random ID from rand.Seed(1)
- ErrorCode: []byte{0, 0, 0, 0},
+ clientID: &[]byte{0, 1},
+ Flags: 0x00,
+ IsReply: 0x00,
+ Type: [2]byte{0, 0x76},
Fields: []Field{
NewField(FieldChatID, []byte{0, 0, 0, 1}),
NewField(FieldUserID, []byte{0, 2}),
},
},
},
- t: &Transaction{
- ID: []byte{0, 0, 0, 1},
- Type: []byte{0, 1},
- },
+ t: &Transaction{},
},
want: []Transaction{
{
- clientID: &[]byte{1, 1},
- Flags: 0x00,
- IsReply: 0x01,
- Type: []byte{0, 0},
- ID: []byte{0, 0, 0, 1},
- ErrorCode: []byte{0, 0, 0, 0},
+ clientID: &[]byte{1, 1},
+ IsReply: 0x01,
Fields: []Field{
NewField(
FieldUsernameWithInfo,
},
want: []Transaction{
{
- clientID: &[]byte{0, 1},
- Flags: 0x00,
- IsReply: 0x00,
- Type: []byte{0, 0x6a},
- ID: []byte{0x9a, 0xcb, 0x04, 0x42}, // Random ID from rand.Seed(1)
- ErrorCode: []byte{0, 0, 0, 0},
+ clientID: &[]byte{0, 1},
+ Flags: 0x00,
+ IsReply: 0x00,
+ Type: [2]byte{0, 0x6a},
Fields: []Field{
NewField(FieldData, []byte{0x0d, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x01, 0x3a, 0x20, 0x20, 0x68, 0x61, 0x69}),
},
},
{
- clientID: &[]byte{0, 2},
- Flags: 0x00,
- IsReply: 0x00,
- Type: []byte{0, 0x6a},
- ID: []byte{0xf0, 0xc5, 0x34, 0x1e}, // Random ID from rand.Seed(1)
- ErrorCode: []byte{0, 0, 0, 0},
+ clientID: &[]byte{0, 2},
+ Flags: 0x00,
+ IsReply: 0x00,
+ Type: [2]byte{0, 0x6a},
Fields: []Field{
NewField(FieldData, []byte{0x0d, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x01, 0x3a, 0x20, 0x20, 0x68, 0x61, 0x69}),
},
},
want: []Transaction{
{
- clientID: &[]byte{0, 1},
- Flags: 0x00,
- IsReply: 0x00,
- Type: []byte{0, 0x6a},
- ID: []byte{0x9a, 0xcb, 0x04, 0x42}, // Random ID from rand.Seed(1)
- ErrorCode: []byte{0, 0, 0, 0},
+ clientID: &[]byte{0, 1},
+ Type: [2]byte{0, 0x6a},
Fields: []Field{
NewField(FieldData, []byte{0x0d, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x01, 0x3a, 0x20, 0x20, 0x68, 0x61, 0x69}),
},
},
{
- clientID: &[]byte{0, 2},
- Flags: 0x00,
- IsReply: 0x00,
- Type: []byte{0, 0x6a},
- ID: []byte{0xf0, 0xc5, 0x34, 0x1e}, // Random ID from rand.Seed(1)
- ErrorCode: []byte{0, 0, 0, 0},
+ clientID: &[]byte{0, 2},
+ Type: [2]byte{0, 0x6a},
Fields: []Field{
NewField(FieldData, []byte{0x0d, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x01, 0x3a, 0x20, 0x20, 0x68, 0x61, 0x69}),
},
},
want: []Transaction{
{
- Flags: 0x00,
IsReply: 0x01,
- Type: []byte{0, 0},
- ID: []byte{0x9a, 0xcb, 0x04, 0x42},
- ErrorCode: []byte{0, 0, 0, 1},
+ ErrorCode: [4]byte{0, 0, 0, 1},
Fields: []Field{
NewField(FieldError, []byte("You are not allowed to participate in chat.")),
},
},
want: []Transaction{
{
- clientID: &[]byte{0, 1},
- Flags: 0x00,
- IsReply: 0x00,
- Type: []byte{0, 0x6a},
- ID: []byte{0x9a, 0xcb, 0x04, 0x42},
- ErrorCode: []byte{0, 0, 0, 0},
+ clientID: &[]byte{0, 1},
+ Flags: 0x00,
+ IsReply: 0x00,
+ Type: [2]byte{0, 0x6a},
Fields: []Field{
NewField(FieldData, []byte("\r*** Testy McTest performed action")),
},
},
{
- clientID: &[]byte{0, 2},
- Flags: 0x00,
- IsReply: 0x00,
- Type: []byte{0, 0x6a},
- ID: []byte{0xf0, 0xc5, 0x34, 0x1e},
- ErrorCode: []byte{0, 0, 0, 0},
+ clientID: &[]byte{0, 2},
+ Flags: 0x00,
+ IsReply: 0x00,
+ Type: [2]byte{0, 0x6a},
Fields: []Field{
NewField(FieldData, []byte("\r*** Testy McTest performed action")),
},
},
want: []Transaction{
{
- clientID: &[]byte{0, 1},
- Flags: 0x00,
- IsReply: 0x00,
- Type: []byte{0, 0x6a},
- ID: []byte{0x9a, 0xcb, 0x04, 0x42},
- ErrorCode: []byte{0, 0, 0, 0},
+ clientID: &[]byte{0, 1},
+ Type: [2]byte{0, 0x6a},
Fields: []Field{
NewField(FieldData, []byte("\r Testy McTest: hello")),
},
},
{
- clientID: &[]byte{0, 2},
- Flags: 0x00,
- IsReply: 0x00,
- Type: []byte{0, 0x6a},
- ID: []byte{0xf0, 0xc5, 0x34, 0x1e},
- ErrorCode: []byte{0, 0, 0, 0},
+ clientID: &[]byte{0, 2},
+ Type: [2]byte{0, 0x6a},
Fields: []Field{
NewField(FieldData, []byte("\r Testy McTest: hello")),
},
},
want: []Transaction{
{
- clientID: &[]byte{0, 1},
- Flags: 0x00,
- IsReply: 0x00,
- Type: []byte{0, 0x6a},
- ID: []byte{0x9a, 0xcb, 0x04, 0x42}, // Random ID from rand.Seed(1)
- ErrorCode: []byte{0, 0, 0, 0},
+ clientID: &[]byte{0, 1},
+ Type: [2]byte{0, 0x6a},
Fields: []Field{
NewField(FieldData, []byte{0x0d, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x01, 0x3a, 0x20, 0x20, 0x68, 0x61, 0x69}),
},
},
want: []Transaction{
{
- clientID: &[]byte{0, 1},
- Flags: 0x00,
- IsReply: 0x00,
- Type: []byte{0, 0x6a},
- ID: []byte{0x9a, 0xcb, 0x04, 0x42},
- ErrorCode: []byte{0, 0, 0, 0},
+ clientID: &[]byte{0, 1},
+ Type: [2]byte{0, 0x6a},
Fields: []Field{
NewField(FieldChatID, []byte{0, 0, 0, 1}),
NewField(FieldData, []byte{0x0d, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x01, 0x3a, 0x20, 0x20, 0x68, 0x61, 0x69}),
},
},
{
- clientID: &[]byte{0, 2},
- Flags: 0x00,
- IsReply: 0x00,
- Type: []byte{0, 0x6a},
- ID: []byte{0x9a, 0xcb, 0x04, 0x42},
- ErrorCode: []byte{0, 0, 0, 0},
+ clientID: &[]byte{0, 2},
+ Type: [2]byte{0, 0x6a},
Fields: []Field{
NewField(FieldChatID, []byte{0, 0, 0, 1}),
NewField(FieldData, []byte{0x0d, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x01, 0x3a, 0x20, 0x20, 0x68, 0x61, 0x69}),
},
wantRes: []Transaction{
{
- clientID: &[]byte{0, 1},
- Flags: 0x00,
- IsReply: 0x01,
- Type: []byte{0, 0},
- ID: []byte{0x9a, 0xcb, 0x04, 0x42}, // Random ID from rand.Seed(1)
- ErrorCode: []byte{0, 0, 0, 0},
+ clientID: &[]byte{0, 1},
+ IsReply: 0x01,
+ Type: [2]byte{0, 0},
Fields: []Field{
NewField(FieldFileName, []byte("testfile.txt")),
NewField(FieldFileTypeString, []byte("Text File")),
},
wantRes: []Transaction{
{
- Flags: 0x00,
IsReply: 0x01,
- Type: []byte{0, 0},
- ID: []byte{0x9a, 0xcb, 0x04, 0x42},
- ErrorCode: []byte{0, 0, 0, 1},
+ ErrorCode: [4]byte{0, 0, 0, 1},
Fields: []Field{
NewField(FieldError, []byte("You are not allowed to create folders.")),
},
},
wantRes: []Transaction{
{
- clientID: &[]byte{0, 1},
- Flags: 0x00,
- IsReply: 0x01,
- Type: []byte{0, 0},
- ID: []byte{0x9a, 0xcb, 0x04, 0x42}, // Random ID from rand.Seed(1)
- ErrorCode: []byte{0, 0, 0, 0},
+ clientID: &[]byte{0, 1},
+ IsReply: 0x01,
},
},
wantErr: false,
},
wantRes: []Transaction{
{
- clientID: &[]byte{0, 1},
- Flags: 0x00,
- IsReply: 0x01,
- Type: []byte{0, 0},
- ID: []byte{0x9a, 0xcb, 0x04, 0x42}, // Random ID from rand.Seed(1)
- ErrorCode: []byte{0, 0, 0, 0},
+ clientID: &[]byte{0, 1},
+ IsReply: 0x01,
},
},
wantErr: false,
},
wantRes: []Transaction{
{
- clientID: &[]byte{0, 1},
- Flags: 0x00,
- IsReply: 0x01,
- Type: []byte{0, 0},
- ID: []byte{0x9a, 0xcb, 0x04, 0x42}, // Random ID from rand.Seed(1)
- ErrorCode: []byte{0, 0, 0, 0},
+ clientID: &[]byte{0, 1},
+ IsReply: 0x01,
},
}, wantErr: false,
},
},
wantRes: []Transaction{
{
- clientID: &[]byte{0, 1},
- Flags: 0x00,
- IsReply: 0x01,
- Type: []byte{0, 0},
- ID: []byte{0x9a, 0xcb, 0x04, 0x42}, // Random ID from rand.Seed(1)
- ErrorCode: []byte{0, 0, 0, 0},
+ clientID: &[]byte{0, 1},
+ IsReply: 0x01,
},
}, wantErr: false,
},
},
wantRes: []Transaction{
{
- Flags: 0x00,
- IsReply: 0x01,
- Type: []byte{0, 0},
- ID: []byte{0x9a, 0xcb, 0x04, 0x42},
- ErrorCode: []byte{0, 0, 0, 0},
+ IsReply: 0x01,
Fields: []Field{
NewField(FieldRefNum, []byte{0x52, 0xfd, 0xfc, 0x07}), // rand.Seed(1)
},
},
wantRes: []Transaction{
{
- Flags: 0x00,
IsReply: 0x01,
- Type: []byte{0, 0},
- ID: []byte{0x9a, 0xcb, 0x04, 0x42},
- ErrorCode: []byte{0, 0, 0, 1},
+ ErrorCode: [4]byte{0, 0, 0, 1},
Fields: []Field{
NewField(FieldError, []byte("You are not allowed to upload files.")), // rand.Seed(1)
},
},
wantRes: []Transaction{
{
- Flags: 0x00,
- IsReply: 0x01,
- Type: []byte{0, 0},
- ID: []byte{0x9a, 0xcb, 0x04, 0x42},
- ErrorCode: []byte{0, 0, 0, 0},
- Fields: []Field(nil),
+ IsReply: 0x01,
+ Fields: []Field(nil),
},
},
wantErr: false,
},
wantRes: []Transaction{
{
- Flags: 0x00,
IsReply: 0x01,
- Type: []byte{0, 0},
- ID: []byte{0x9a, 0xcb, 0x04, 0x42},
- ErrorCode: []byte{0, 0, 0, 1},
+ ErrorCode: [4]byte{0, 0, 0, 1},
Fields: []Field{
NewField(FieldError, []byte("Error creating alias")),
},
},
wantRes: []Transaction{
{
- Flags: 0x00,
IsReply: 0x01,
- Type: []byte{0, 0},
- ID: []byte{0x9a, 0xcb, 0x04, 0x42},
- ErrorCode: []byte{0, 0, 0, 1},
+ ErrorCode: [4]byte{0, 0, 0, 1},
Fields: []Field{
NewField(FieldError, []byte("You are not allowed to make aliases.")),
},
},
wantRes: []Transaction{
{
- Flags: 0x00,
- IsReply: 0x01,
- Type: []byte{0, 0},
- ID: []byte{0x9a, 0xcb, 0x04, 0x42},
- ErrorCode: []byte{0, 0, 0, 0},
+ IsReply: 0x01,
Fields: []Field{
NewField(FieldUserName, []byte("Guest")),
NewField(FieldUserLogin, encodeString([]byte("guest"))),
},
wantRes: []Transaction{
{
- Flags: 0x00,
IsReply: 0x01,
- Type: []byte{0, 0},
- ID: []byte{0x9a, 0xcb, 0x04, 0x42},
- ErrorCode: []byte{0, 0, 0, 1},
+ ErrorCode: [4]byte{0, 0, 0, 1},
Fields: []Field{
NewField(FieldError, []byte("You are not allowed to view accounts.")),
},
{
Flags: 0x00,
IsReply: 0x01,
- Type: []byte{0, 0},
- ID: []byte{0x9a, 0xcb, 0x04, 0x42},
- ErrorCode: []byte{0, 0, 0, 1},
+ Type: [2]byte{0, 0},
+ ErrorCode: [4]byte{0, 0, 0, 1},
Fields: []Field{
NewField(FieldError, []byte("Account does not exist.")),
},
},
wantRes: []Transaction{
{
- Flags: 0x00,
- IsReply: 0x01,
- Type: []byte{0, 0},
- ID: []byte{0x9a, 0xcb, 0x04, 0x42},
- ErrorCode: []byte{0, 0, 0, 0},
- Fields: []Field(nil),
+ Flags: 0x00,
+ IsReply: 0x01,
+ Type: [2]byte{0, 0},
+ Fields: []Field(nil),
},
},
wantErr: assert.NoError,
},
wantRes: []Transaction{
{
- Flags: 0x00,
IsReply: 0x01,
- Type: []byte{0, 0},
- ID: []byte{0x9a, 0xcb, 0x04, 0x42},
- ErrorCode: []byte{0, 0, 0, 1},
+ ErrorCode: [4]byte{0, 0, 0, 1},
Fields: []Field{
NewField(FieldError, []byte("You are not allowed to delete accounts.")),
},
},
wantRes: []Transaction{
{
- Flags: 0x00,
- IsReply: 0x01,
- Type: []byte{0, 0},
- ID: []byte{0x9a, 0xcb, 0x04, 0x42},
- ErrorCode: []byte{0, 0, 0, 0},
+ IsReply: 0x01,
Fields: []Field{
NewField(FieldData, []byte("TEST")),
},
},
wantRes: []Transaction{
{
- Flags: 0x00,
IsReply: 0x01,
- Type: []byte{0, 0},
- ID: []byte{0x9a, 0xcb, 0x04, 0x42},
- ErrorCode: []byte{0, 0, 0, 1},
+ ErrorCode: [4]byte{0, 0, 0, 1},
Fields: []Field{
NewField(FieldError, []byte("You are not allowed to read news.")),
},
},
wantRes: []Transaction{
{
- Flags: 0x00,
IsReply: 0x01,
- Type: []byte{0, 0},
- ID: []byte{0x9a, 0xcb, 0x04, 0x42},
- ErrorCode: []byte{0, 0, 0, 1},
+ ErrorCode: [4]byte{0, 0, 0, 1},
Fields: []Field{
NewField(FieldError, []byte("You are not allowed to create new accounts.")),
},
},
wantRes: []Transaction{
{
- Flags: 0x00,
IsReply: 0x01,
- Type: []byte{0, 0},
- ID: []byte{0x9a, 0xcb, 0x04, 0x42},
- ErrorCode: []byte{0, 0, 0, 1},
+ ErrorCode: [4]byte{0, 0, 0, 1},
Fields: []Field{
NewField(FieldError, []byte("Cannot create account with more access than yourself.")),
},
},
wantRes: []Transaction{
{
- Flags: 0x00,
IsReply: 0x01,
- Type: []byte{0, 0},
- ID: []byte{0x9a, 0xcb, 0x04, 0x42},
- ErrorCode: []byte{0, 0, 0, 1},
+ ErrorCode: [4]byte{0, 0, 0, 1},
Fields: []Field{
NewField(FieldError, []byte("You are not allowed to view accounts.")),
},
},
wantRes: []Transaction{
{
- Flags: 0x00,
- IsReply: 0x01,
- Type: []byte{0, 0},
- ID: []byte{0, 0, 0, 0},
- ErrorCode: []byte{0, 0, 0, 0},
+ IsReply: 0x01,
Fields: []Field{
NewField(FieldData, []byte{
0x00, 0x04, 0x00, 0x66, 0x00, 0x05, 0x67, 0x75, 0x65, 0x73, 0x74, 0x00, 0x69, 0x00, 0x05, 0x98,
},
wantRes: []Transaction{
{
- Flags: 0x00,
IsReply: 0x01,
- Type: []byte{0, 0},
- ID: []byte{0x9a, 0xcb, 0x04, 0x42},
- ErrorCode: []byte{0, 0, 0, 1},
+ ErrorCode: [4]byte{0, 0, 0, 1},
Fields: []Field{
NewField(FieldError, []byte("You are not allowed to download files.")),
},
},
wantRes: []Transaction{
{
- Flags: 0x00,
- IsReply: 0x01,
- Type: []byte{0, 0},
- ID: []byte{0x9a, 0xcb, 0x04, 0x42},
- ErrorCode: []byte{0, 0, 0, 0},
+ IsReply: 0x01,
Fields: []Field{
NewField(FieldRefNum, []byte{0x52, 0xfd, 0xfc, 0x07}),
NewField(FieldWaitingCount, []byte{0x00, 0x00}),
},
wantRes: []Transaction{
{
- Flags: 0x00,
- IsReply: 0x01,
- Type: []byte{0, 0},
- ID: []byte{0x9a, 0xcb, 0x04, 0x42},
- ErrorCode: []byte{0, 0, 0, 0},
+ IsReply: 0x01,
Fields: []Field{
NewField(FieldRefNum, []byte{0x52, 0xfd, 0xfc, 0x07}),
NewField(FieldWaitingCount, []byte{0x00, 0x00}),
},
wantRes: []Transaction{
{
- Flags: 0x00,
IsReply: 0x01,
- Type: []byte{0, 0},
- ID: []byte{0x9a, 0xcb, 0x04, 0x42},
- ErrorCode: []byte{0, 0, 0, 1},
+ ErrorCode: [4]byte{0, 0, 0, 1},
Fields: []Field{
NewField(FieldError, []byte("You are not allowed to create new accounts.")),
},
},
wantRes: []Transaction{
{
- Flags: 0x00,
IsReply: 0x01,
- Type: []byte{0, 0},
- ID: []byte{0x9a, 0xcb, 0x04, 0x42},
- ErrorCode: []byte{0, 0, 0, 1},
+ ErrorCode: [4]byte{0, 0, 0, 1},
Fields: []Field{
NewField(FieldError, []byte("You are not allowed to modify accounts.")),
},
},
wantRes: []Transaction{
{
- Flags: 0x00,
IsReply: 0x01,
- Type: []byte{0, 0},
- ID: []byte{0x9a, 0xcb, 0x04, 0x42},
- ErrorCode: []byte{0, 0, 0, 1},
+ ErrorCode: [4]byte{0, 0, 0, 1},
Fields: []Field{
NewField(FieldError, []byte("You are not allowed to delete accounts.")),
},
},
wantRes: []Transaction{
{
- Flags: 0x00,
IsReply: 0x01,
- Type: []byte{0, 0},
- ID: []byte{0x9a, 0xcb, 0x04, 0x42},
- ErrorCode: []byte{0, 0, 0, 1},
+ ErrorCode: [4]byte{0, 0, 0, 1},
Fields: []Field{
NewField(FieldError, []byte("You are not allowed to delete news articles.")),
},
},
wantRes: []Transaction{
{
- Flags: 0x00,
IsReply: 0x01,
- Type: []byte{0, 0},
- ID: []byte{0x9a, 0xcb, 0x04, 0x42},
- ErrorCode: []byte{0, 0, 0, 1},
+ ErrorCode: [4]byte{0, 0, 0, 1},
Fields: []Field{
NewField(FieldError, []byte("You are not allowed to disconnect users.")),
},
},
wantRes: []Transaction{
{
- Flags: 0x00,
IsReply: 0x01,
- Type: []byte{0, 0},
- ID: []byte{0x9a, 0xcb, 0x04, 0x42},
- ErrorCode: []byte{0, 0, 0, 1},
+ ErrorCode: [4]byte{0, 0, 0, 1},
Fields: []Field{
NewField(FieldError, []byte("unnamed is not allowed to be disconnected.")),
},
},
wantRes: []Transaction{
{
- Flags: 0x00,
IsReply: 0x01,
- Type: []byte{0, 0},
- ID: []byte{0, 0, 0, 0},
- ErrorCode: []byte{0, 0, 0, 1},
+ ErrorCode: [4]byte{0, 0, 0, 1},
Fields: []Field{
NewField(FieldError, []byte("You are not allowed to send private messages.")),
},
NewField(FieldOptions, []byte{0, 1}),
),
{
- clientID: &[]byte{0, 1},
- Flags: 0x00,
- IsReply: 0x01,
- Type: []byte{0, 0},
- ID: []byte{0, 0, 0, 0},
- ErrorCode: []byte{0, 0, 0, 0},
- Fields: []Field(nil),
+ clientID: &[]byte{0, 1},
+ IsReply: 0x01,
+ Fields: []Field(nil),
},
},
wantErr: assert.NoError,
NewField(FieldOptions, []byte{0, 1}),
),
{
- clientID: &[]byte{0, 1},
- Flags: 0x00,
- IsReply: 0x01,
- Type: []byte{0, 0},
- ID: []byte{0, 0, 0, 0},
- ErrorCode: []byte{0, 0, 0, 0},
- Fields: []Field(nil),
+ clientID: &[]byte{0, 1},
+ IsReply: 0x01,
+ Fields: []Field(nil),
},
},
wantErr: assert.NoError,
NewField(FieldOptions, []byte{0, 2}),
),
{
- clientID: &[]byte{0, 1},
- Flags: 0x00,
- IsReply: 0x01,
- Type: []byte{0, 0},
- ID: []byte{0, 0, 0, 0},
- ErrorCode: []byte{0, 0, 0, 0},
- Fields: []Field(nil),
+ clientID: &[]byte{0, 1},
+ IsReply: 0x01,
+ Fields: []Field(nil),
},
},
wantErr: assert.NoError,
},
wantRes: []Transaction{
{
- Flags: 0x00,
IsReply: 0x01,
- Type: []byte{0, 0},
- ID: []byte{0x9a, 0xcb, 0x04, 0x42},
- ErrorCode: []byte{0, 0, 0, 1},
+ ErrorCode: [4]byte{0, 0, 0, 1},
Fields: []Field{
NewField(FieldError, []byte("You are not allowed to delete files.")),
},
},
wantRes: []Transaction{
{
- Flags: 0x00,
- IsReply: 0x01,
- Type: []byte{0, 0},
- ID: []byte{0x0, 0x0, 0x0, 0x0},
- ErrorCode: []byte{0, 0, 0, 0},
- Fields: []Field(nil),
+ IsReply: 0x01,
+ Fields: []Field(nil),
},
},
wantErr: assert.NoError,
},
wantRes: []Transaction{
{
- Flags: 0x00,
IsReply: 0x01,
- Type: []byte{0, 0},
- ID: []byte{0, 0, 0, 0},
- ErrorCode: []byte{0, 0, 0, 1},
+ ErrorCode: [4]byte{0, 0, 0, 1},
Fields: []Field{
NewField(FieldError, []byte("You are not allowed to view drop boxes.")),
},
},
wantRes: []Transaction{
{
- Flags: 0x00,
- IsReply: 0x01,
- Type: []byte{0, 0},
- ID: []byte{0, 0, 0, 0},
- ErrorCode: []byte{0, 0, 0, 0},
+ IsReply: 0x01,
Fields: []Field{
NewField(
FieldFileNameWithInfo,
},
wantRes: []Transaction{
{
- Flags: 0x00,
IsReply: 0x01,
- Type: []byte{0, 0},
- ID: []byte{0, 0, 0, 0},
- ErrorCode: []byte{0, 0, 0, 1},
+ ErrorCode: [4]byte{0, 0, 0, 1},
Fields: []Field{
NewField(FieldError, []byte("You are not allowed to get client info.")),
},
},
wantRes: []Transaction{
{
- Flags: 0x00,
- IsReply: 0x01,
- Type: []byte{0, 0},
- ID: []byte{0, 0, 0, 0},
- ErrorCode: []byte{0, 0, 0, 0},
+ IsReply: 0x01,
Fields: []Field{
NewField(FieldData, []byte(
strings.ReplaceAll(`Nickname: Testy McTest
},
wantRes: []Transaction{
{
- clientID: &[]byte{0, 1},
- Flags: 0x00,
- IsReply: 0x00,
- Type: []byte{0, 0x7a},
- ID: []byte{0, 0, 0, 0},
- ErrorCode: []byte{0, 0, 0, 0},
+ clientID: &[]byte{0, 1},
+ Type: [2]byte{0, 0x7a},
Fields: []Field{
NewField(FieldBannerType, []byte("JPEG")),
},
},
{
- clientID: &[]byte{0, 1},
- Flags: 0x00,
- IsReply: 0x01,
- Type: []byte{0, 0},
- ID: []byte{0, 0, 0, 0},
- ErrorCode: []byte{0, 0, 0, 0},
- Fields: []Field{},
+ clientID: &[]byte{0, 1},
+ IsReply: 0x01,
+ Fields: []Field{},
},
},
wantErr: assert.NoError,
},
wantRes: []Transaction{
{
- clientID: &[]byte{0, 1},
- Flags: 0x00,
- IsReply: 0x00,
- Type: []byte{0x01, 0x2d},
- ID: []byte{0, 0, 0, 0},
- ErrorCode: []byte{0, 0, 0, 0},
+ clientID: &[]byte{0, 1},
+ Type: [2]byte{0x01, 0x2d},
Fields: []Field{
NewField(FieldUserID, []byte{0, 1}),
NewField(FieldUserIconID, []byte{0, 1}),
wantRes: []Transaction{
{
clientID: &[]byte{0, 1},
- Flags: 0x00,
IsReply: 0x01,
- Type: []byte{0, 0},
- ID: []byte{0, 0, 0, 0},
- ErrorCode: []byte{0, 0, 0, 1},
+ ErrorCode: [4]byte{0, 0, 0, 1},
Fields: []Field{
NewField(FieldError, []byte("You are not allowed to delete news categories.")),
},
wantRes: []Transaction{
{
clientID: &[]byte{0, 1},
- Flags: 0x00,
IsReply: 0x01,
- Type: []byte{0, 0},
- ID: []byte{0, 0, 0, 0},
- ErrorCode: []byte{0, 0, 0, 1},
+ ErrorCode: [4]byte{0, 0, 0, 1},
Fields: []Field{
NewField(FieldError, []byte("You are not allowed to delete news folders.")),
},
},
wantRes: []Transaction{
{
- clientID: &[]byte{0, 1},
- Flags: 0x00,
- IsReply: 0x01,
- Type: []byte{0, 0},
- ID: []byte{0, 0, 0, 0},
- ErrorCode: []byte{0, 0, 0, 0},
- Fields: []Field{},
+ clientID: &[]byte{0, 1},
+ IsReply: 0x01,
+ Fields: []Field{},
},
},
wantErr: assert.NoError,
},
wantRes: []Transaction{
{
- Flags: 0x00,
IsReply: 0x01,
- Type: []byte{0, 0},
- ID: []byte{0, 0, 0, 0},
- ErrorCode: []byte{0, 0, 0, 1},
+ ErrorCode: [4]byte{0, 0, 0, 1},
Fields: []Field{
NewField(FieldError, []byte("You are not allowed to post news.")),
},
},
wantRes: []Transaction{
{
- Flags: 0x00,
- IsReply: 0x01,
- Type: []byte{0, 0},
- ID: []byte{0, 0, 0, 0},
- ErrorCode: []byte{0, 0, 0, 0},
+ IsReply: 0x01,
},
},
wantErr: assert.NoError,
},
wantRes: []Transaction{
{
- Flags: 0x00,
IsReply: 0x01,
- Type: []byte{0, 0},
- ID: []byte{0, 0, 0, 0},
- ErrorCode: []byte{0, 0, 0, 1},
+ ErrorCode: [4]byte{0, 0, 0, 1},
Fields: []Field{
NewField(FieldError, []byte("You are not allowed to request private chat.")),
},
},
wantRes: []Transaction{
{
- clientID: &[]byte{0, 2},
- Flags: 0x00,
- IsReply: 0x00,
- Type: []byte{0, 0x71},
- ID: []byte{0, 0, 0, 0},
- ErrorCode: []byte{0, 0, 0, 0},
+ clientID: &[]byte{0, 2},
+ Type: [2]byte{0, 0x71},
Fields: []Field{
NewField(FieldChatID, []byte{0x52, 0xfd, 0xfc, 0x07}),
NewField(FieldUserName, []byte("UserA")),
},
{
- clientID: &[]byte{0, 1},
- Flags: 0x00,
- IsReply: 0x01,
- Type: []byte{0, 0},
- ID: []byte{0, 0, 0, 0},
- ErrorCode: []byte{0, 0, 0, 0},
+ clientID: &[]byte{0, 1},
+ IsReply: 0x01,
Fields: []Field{
NewField(FieldChatID, []byte{0x52, 0xfd, 0xfc, 0x07}),
NewField(FieldUserName, []byte("UserA")),
},
wantRes: []Transaction{
{
- clientID: &[]byte{0, 1},
- Flags: 0x00,
- IsReply: 0x00,
- Type: []byte{0, 0x68},
- ID: []byte{0, 0, 0, 0},
- ErrorCode: []byte{0, 0, 0, 0},
+ clientID: &[]byte{0, 1},
+ Type: [2]byte{0, 0x68},
Fields: []Field{
NewField(FieldData, []byte("UserB does not accept private chats.")),
NewField(FieldUserName, []byte("UserB")),
},
},
{
- clientID: &[]byte{0, 1},
- Flags: 0x00,
- IsReply: 0x01,
- Type: []byte{0, 0},
- ID: []byte{0, 0, 0, 0},
- ErrorCode: []byte{0, 0, 0, 0},
+ clientID: &[]byte{0, 1},
+ IsReply: 0x01,
Fields: []Field{
NewField(FieldChatID, []byte{0x52, 0xfd, 0xfc, 0x07}),
NewField(FieldUserName, []byte("UserA")),
},
wantRes: []Transaction{
{
- Flags: 0x00,
IsReply: 0x01,
- Type: []byte{0, 0},
- ID: []byte{0x9a, 0xcb, 0x04, 0x42},
- ErrorCode: []byte{0, 0, 0, 1},
+ ErrorCode: [4]byte{0, 0, 0, 1},
Fields: []Field{
NewField(FieldError, []byte("You are not allowed to read news.")),
},
{
Flags: 0x00,
IsReply: 0x01,
- Type: []byte{0, 0},
- ErrorCode: []byte{0, 0, 0, 1},
+ Type: [2]byte{0, 0},
+ ErrorCode: [4]byte{0, 0, 0, 1},
Fields: []Field{
NewField(FieldError, []byte("You are not allowed to read news.")),
},
},
wantRes: []Transaction{
{
- Flags: 0x00,
- IsReply: 0x01,
- Type: []byte{0, 0},
- ErrorCode: []byte{0, 0, 0, 0},
+ IsReply: 0x01,
Fields: []Field{
NewField(FieldNewsArtListData, []byte{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
{
Flags: 0x00,
IsReply: 0x01,
- Type: []byte{0, 0},
- ErrorCode: []byte{0, 0, 0, 1},
+ Type: [2]byte{0, 0},
+ ErrorCode: [4]byte{0, 0, 0, 1},
Fields: []Field{
NewField(FieldError, []byte("You are not allowed to create news folders.")),
},
},
wantRes: []Transaction{
{
- clientID: &[]byte{0, 1},
- Flags: 0x00,
- IsReply: 0x01,
- Type: []byte{0, 0},
- ID: []byte{0, 0, 0, 0},
- ErrorCode: []byte{0, 0, 0, 0},
- Fields: []Field{},
+ clientID: &[]byte{0, 1},
+ IsReply: 0x01,
+ Fields: []Field{},
},
},
wantErr: assert.NoError,
// clientID: &[]byte{0, 1},
// Flags: 0x00,
// IsReply: 0x01,
- // Type: []byte{0, 0},
- // ErrorCode: []byte{0, 0, 0, 1},
+ // Type: [2]byte{0, 0},
+ // ErrorCode: [4]byte{0, 0, 0, 1},
// Fields: []Field{
// NewField(FieldError, []byte("Error creating news folder.")),
// },