MCPcopy
hub / github.com/gorilla/websocket / TestValidCompressionLevel

Function TestValidCompressionLevel

compression_test.go:68–80  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

66}
67
68func TestValidCompressionLevel(t *testing.T) {
69 c := newTestConn(nil, nil, false)
70 for _, level := range []int{minCompressionLevel - 1, maxCompressionLevel + 1} {
71 if err := c.SetCompressionLevel(level); err == nil {
72 t.Errorf("no error for level %d", level)
73 }
74 }
75 for _, level := range []int{minCompressionLevel, maxCompressionLevel} {
76 if err := c.SetCompressionLevel(level); err != nil {
77 t.Errorf("error for level %d", level)
78 }
79 }
80}

Callers

nothing calls this directly

Calls 2

newTestConnFunction · 0.85
SetCompressionLevelMethod · 0.80

Tested by

no test coverage detected