1
0
mirror of https://github.com/veggiedefender/torrent-client.git synced 2025-11-06 09:29:16 +02:00

Shorten Message.String() output

This commit is contained in:
Jesse
2019-12-26 11:21:14 -05:00
parent f2768fefd6
commit 5201cfc0b4
2 changed files with 24 additions and 27 deletions

View File

@@ -196,17 +196,17 @@ func TestString(t *testing.T) {
output string
}{
{nil, "KeepAlive"},
{&Message{MsgChoke, []byte{1, 2, 3}}, "Choke\t[01 02 03]"},
{&Message{MsgUnchoke, []byte{1, 2, 3}}, "Unchoke\t[01 02 03]"},
{&Message{MsgInterested, []byte{1, 2, 3}}, "Interested\t[01 02 03]"},
{&Message{MsgNotInterested, []byte{1, 2, 3}}, "NotInterested\t[01 02 03]"},
{&Message{MsgHave, []byte{1, 2, 3}}, "Have\t[01 02 03]"},
{&Message{MsgBitfield, []byte{1, 2, 3}}, "Bitfield\t[01 02 03]"},
{&Message{MsgRequest, []byte{1, 2, 3}}, "Request\t[01 02 03]"},
{&Message{MsgPiece, []byte{1, 2, 3}}, "Piece\t[01 02 03]"},
{&Message{MsgCancel, []byte{1, 2, 3}}, "Cancel\t[01 02 03]"},
{&Message{MsgPort, []byte{1, 2, 3}}, "Port\t[01 02 03]"},
{&Message{99, []byte{1, 2, 3}}, "Unknown#99\t[01 02 03]"},
{&Message{MsgChoke, []byte{1, 2, 3}}, "Choke"},
{&Message{MsgUnchoke, []byte{1, 2, 3}}, "Unchoke"},
{&Message{MsgInterested, []byte{1, 2, 3}}, "Interested"},
{&Message{MsgNotInterested, []byte{1, 2, 3}}, "NotInterested"},
{&Message{MsgHave, []byte{1, 2, 3}}, "Have"},
{&Message{MsgBitfield, []byte{1, 2, 3}}, "Bitfield"},
{&Message{MsgRequest, []byte{1, 2, 3}}, "Request"},
{&Message{MsgPiece, []byte{1, 2, 3}}, "Piece"},
{&Message{MsgCancel, []byte{1, 2, 3}}, "Cancel"},
{&Message{MsgPort, []byte{1, 2, 3}}, "Port"},
{&Message{99, []byte{1, 2, 3}}, "Unknown#99"},
}
for _, test := range tests {