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

Function TestInflowTake

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

Source from the content-addressed store, hash-verified

14}
15
16func TestInflowTake(t *testing.T) {
17 var f inflow
18 f.init(1000)
19 if !f.take(500) {
20 t.Fatal("take(500) should succeed with avail=1000")
21 }
22 if f.avail != 500 {
23 t.Fatalf("avail = %d, want 500 after take(500)", f.avail)
24 }
25 if f.take(501) {
26 t.Fatal("take(501) should fail with avail=500")
27 }
28}
29
30func TestInflowAdd(t *testing.T) {
31 var f inflow

Callers

nothing calls this directly

Calls 2

initMethod · 0.95
takeMethod · 0.95

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…