mirror of
https://github.com/mochi-mqtt/server.git
synced 2025-10-25 17:10:36 +08:00
Combines two fixes
This commit is contained in:
@@ -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())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user