Skip to content

Commit 80cff25

Browse files
committed
fix unit
1 parent 5c18495 commit 80cff25

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

client/client_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ func TestSendPacket(t *testing.T) {
8383

8484
ret, _ := client.SendPacket(roc.NewPacket(1, "sss"))
8585

86-
assert.Equal(t, 1, ret)
86+
assert.Equal(t, uint32(1), ret)
8787
}
8888

8989
type FooRequest struct {

formatter/json_rpc_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ func TestFormatByteToRequest(t *testing.T) {
6363
fmt.Println(e)
6464
}
6565

66-
assert.Equal(t, 1, req.Data.Id)
66+
assert.Equal(t, uint(1), req.Data.Id)
6767
assert.Equal(t, "Hyperf", req.Data.Name)
68-
assert.Equal(t, 123, req.Data.DataId.Id)
68+
assert.Equal(t, uint64(123), req.Data.DataId.Id)
6969
}
7070

7171
func TestFormatRequestToByte(t *testing.T) {

id_generator_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77

88
func TestIdGeneratorGenerate(t *testing.T) {
99
generator := &IdGenerator{id: 0}
10-
assert.Equal(t, 1, generator.Generate())
10+
assert.Equal(t, uint32(1), generator.Generate())
1111
ch := make(chan uint32, 100)
1212
for i := 0; i < 10; i++ {
1313
go func() {

packet_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ import (
77

88
func TestPacketNew(t *testing.T) {
99
packet := &Packet{1, "Hello World"}
10-
assert.Equal(t, packet.GetId(), 1)
10+
assert.Equal(t, packet.GetId(), uint32(1))
1111
assert.Equal(t, packet.GetBody(), "Hello World")
1212
}
1313

14-
func Test_Packet_Is_Heartbeat(t *testing.T) {
14+
func TestPacketIsHeartbeat(t *testing.T) {
1515
packet := &Packet{0, PONG}
1616
assert.True(t, packet.IsHeartbeat())
1717

0 commit comments

Comments
 (0)