MCPcopy Create free account
hub / github.com/imroc/req / TestFrameParserReservedFrameType

Function TestFrameParserReservedFrameType

internal/http3/frames_test.go:11–34  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

9)
10
11func TestFrameParserReservedFrameType(t *testing.T) {
12 for _, ft := range []uint64{0x2, 0x6, 0x8, 0x9} {
13 data := quicvarint.Append(nil, ft)
14 data = quicvarint.Append(data, 6)
15 data = append(data, []byte("foobar")...)
16
17 var closed bool
18 fp := frameParser{
19 streamID: 42,
20 r: bytes.NewReader(data),
21 closeConn: func(quic.ApplicationErrorCode, string) error {
22 closed = true
23 return nil
24 },
25 }
26 _, err := fp.ParseNext(nil)
27 if err == nil {
28 t.Fatalf("expected error for reserved frame type %d", ft)
29 }
30 if !closed {
31 t.Fatalf("expected connection to be closed for reserved frame type %d", ft)
32 }
33 }
34}
35
36func TestFrameParserUnknownFrameType(t *testing.T) {
37 data := quicvarint.Append(nil, 0xdead)

Callers

nothing calls this directly

Calls 2

ParseNextMethod · 0.95
AppendMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…