(t *testing.T)
| 49 | } |
| 50 | |
| 51 | func TestTakeInflows(t *testing.T) { |
| 52 | var f1, f2 inflow |
| 53 | f1.init(1000) |
| 54 | f2.init(500) |
| 55 | if !takeInflows(&f1, &f2, 400) { |
| 56 | t.Fatal("takeInflows(400) should succeed") |
| 57 | } |
| 58 | if f1.avail != 600 { |
| 59 | t.Fatalf("f1.avail = %d, want 600", f1.avail) |
| 60 | } |
| 61 | if f2.avail != 100 { |
| 62 | t.Fatalf("f2.avail = %d, want 100", f2.avail) |
| 63 | } |
| 64 | if takeInflows(&f1, &f2, 200) { |
| 65 | t.Fatal("takeInflows(200) should fail (f2 only has 100)") |
| 66 | } |
| 67 | } |
| 68 | |
| 69 | func TestOutflowAvailable(t *testing.T) { |
| 70 | var conn outflow |
nothing calls this directly
no test coverage detected
searching dependent graphs…