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

Function TestFrameTypeString

internal/http2/frame_test.go:10–32  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

8)
9
10func TestFrameTypeString(t *testing.T) {
11 tests := []struct {
12 ft FrameType
13 expected string
14 }{
15 {FrameData, "DATA"},
16 {FrameHeaders, "HEADERS"},
17 {FramePriority, "PRIORITY"},
18 {FrameRSTStream, "RST_STREAM"},
19 {FrameSettings, "SETTINGS"},
20 {FramePushPromise, "PUSH_PROMISE"},
21 {FramePing, "PING"},
22 {FrameGoAway, "GOAWAY"},
23 {FrameWindowUpdate, "WINDOW_UPDATE"},
24 {FrameContinuation, "CONTINUATION"},
25 {FrameType(0xFF), "UNKNOWN_FRAME_TYPE_255"},
26 }
27 for _, tt := range tests {
28 if got := tt.ft.String(); got != tt.expected {
29 t.Errorf("FrameType(%d).String() = %q, want %q", uint8(tt.ft), got, tt.expected)
30 }
31 }
32}
33
34func TestFlagsHas(t *testing.T) {
35 flags := FlagDataEndStream | FlagDataPadded

Callers

nothing calls this directly

Calls 3

FrameTypeTypeAlias · 0.70
ErrorfMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…