MCPcopy
hub / github.com/coder/websocket / testHeader

Function testHeader

frame_test.go:76–91  ·  view source on GitHub ↗
(t *testing.T, h header)

Source from the content-addressed store, hash-verified

74}
75
76func testHeader(t *testing.T, h header) {
77 b := &bytes.Buffer{}
78 w := bufio.NewWriter(b)
79 r := bufio.NewReader(b)
80
81 err := writeFrameHeader(h, w, make([]byte, 8))
82 assert.Success(t, err)
83
84 err = w.Flush()
85 assert.Success(t, err)
86
87 h2, err := readFrameHeader(r, make([]byte, 8))
88 assert.Success(t, err)
89
90 assert.Equal(t, "read header", h, h2)
91}
92
93func Test_mask(t *testing.T) {
94 t.Parallel()

Callers 1

TestHeaderFunction · 0.85

Calls 4

SuccessFunction · 0.92
EqualFunction · 0.92
writeFrameHeaderFunction · 0.85
readFrameHeaderFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…