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

Function TestSubprotocols

server_test.go:29–37  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

27}
28
29func TestSubprotocols(t *testing.T) {
30 for _, st := range subprotocolTests {
31 r := http.Request{Header: http.Header{"Sec-Websocket-Protocol": {st.h}}}
32 protocols := Subprotocols(&r)
33 if !reflect.DeepEqual(st.protocols, protocols) {
34 t.Errorf("SubProtocols(%q) returned %#v, want %#v", st.h, protocols, st.protocols)
35 }
36 }
37}
38
39var isWebSocketUpgradeTests = []struct {
40 ok bool

Callers

nothing calls this directly

Calls 1

SubprotocolsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…