Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
guonaihong committed Aug 19, 2023
1 parent 66c916b commit 36e37de
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions common_options_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1405,6 +1405,37 @@ func Test_CommonOption(t *testing.T) {
}
})

t.Run("13-15.client: WithServerBufioMultipleTimesPayloadSize-Compress-checkUTF8", func(t *testing.T) {
ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
c, err := Upgrade(w, r,
WithServerBufioParseMode(),
WithServerOnMessageFunc(func(c *Conn, op Opcode, payload []byte) {
}))
if err != nil {
t.Error(err)
}
c.StartReadLoop()
}))

defer ts.Close()

url := strings.ReplaceAll(ts.URL, "http", "ws")
con, err := Dial(url,
WithClientEnableUTF8Check(),
WithClientOnMessageFunc(func(c *Conn, op Opcode, payload []byte) {
}))
if err != nil {
t.Error(err)
}
defer con.Close()

err = con.WriteMessageDelay(Text, []byte{128, 129, 130, 131})
if err == nil {
t.Error("not check utf8:method fail")
}
con.StartReadLoop()
})

t.Run("16.1.WithServerReadTimeout:local-Upgrade", func(t *testing.T) {
var tsort testServerOptionReadTimeout

Expand Down

0 comments on commit 36e37de

Please sign in to comment.