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

Function TestInflowAdd

internal/http2/flow_test.go:30–49  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

28}
29
30func TestInflowAdd(t *testing.T) {
31 var f inflow
32 f.init(1000)
33 // Small add should buffer (less than inflowMinRefresh=4096)
34 add := f.add(100)
35 if add != 0 {
36 t.Fatalf("small add should return 0, got %d", add)
37 }
38 if f.unsent != 100 {
39 t.Fatalf("unsent = %d, want 100", f.unsent)
40 }
41 // Large add should trigger window update
42 add = f.add(5000)
43 if add != 5100 {
44 t.Fatalf("large add should return 5100, got %d", add)
45 }
46 if f.unsent != 0 {
47 t.Fatalf("unsent should be 0 after flush, got %d", f.unsent)
48 }
49}
50
51func TestTakeInflows(t *testing.T) {
52 var f1, f2 inflow

Callers

nothing calls this directly

Calls 2

initMethod · 0.95
addMethod · 0.95

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…