Skip to content

Commit

Permalink
暂时移除ws部分的单元测试
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Nov 23, 2023
1 parent 1a0dfb9 commit 6a23303
Showing 1 changed file with 0 additions and 38 deletions.
38 changes: 0 additions & 38 deletions cmd/haobase/message/ws/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,42 +95,4 @@ func TestClient(t *testing.T) {
}

})

// Convey("给拥有订阅属性的客户端发送消息", t, func() {
// ws := newClient()
// defer ws.Close()

// subM := `{"sub":["kline.m1.demo", "latest.price.demo"]}`
// t.Log(subM)
// if err := ws.WriteMessage(websocket.TextMessage, []byte(subM)); err != nil {
// t.Fatalf("%v", err)
// }

// send := MsgBody{
// To: "kline.m1.demo",
// Response: Response{
// Type: "kline.m1.demo",
// Body: []string{
// "a", "b",
// },
// },
// }

// _socket.Broadcast <- send
// _, recv, _ := ws.ReadMessage()

// time.Sleep(time.Second * time.Duration(1))

// So(len(_socket.clients), ShouldEqual, 1)
// t.Logf("%s", recv)
// So(string(recv), ShouldEqualJSON, `{"type":"kline.m1.demo","body":["a","b"]}`)

// for c, _ := range _socket.clients {
// So(c.lastSendMsgHash["kline.m1.demo"], ShouldEqual, "f2534fe3f8a3ffd8243077e8d354eb17")
// }
// })

// Convey("同一类型的消息重复发送去重", t, func() {

// })
}

0 comments on commit 6a23303

Please sign in to comment.