Combines two fixes

This commit is contained in:
Joshua MacDonald
2022-03-17 13:40:46 -07:00
parent 5de12d0460
commit c6643592f6
4 changed files with 68 additions and 33 deletions

View File

@@ -3,6 +3,7 @@ package packets
import (
"bytes"
"errors"
"fmt"
"testing"
"github.com/jinzhu/copier"
@@ -1081,3 +1082,10 @@ func BenchmarkUnsubscribeValidate(b *testing.B) {
pk.UnsubscribeValidate()
}
}
func TestFormatPacketID(t *testing.T) {
for _, id := range []uint16{0, 7, 0x100, 0xffff} {
packet := &Packet{PacketID: id}
require.Equal(t, fmt.Sprint(id), packet.FormatID())
}
}