(t *testing.T)
| 11 | ) |
| 12 | |
| 13 | func TestAfter(t *testing.T) { |
| 14 | t.Parallel() |
| 15 | |
| 16 | arr := []string{"a", "b"} |
| 17 | f := After(len(arr), func(i int) int { |
| 18 | fmt.Println("print done") |
| 19 | return i |
| 20 | }) |
| 21 | type cb func(args ...any) []reflect.Value |
| 22 | print := func(i int, s string, fn cb) { |
| 23 | fmt.Printf("print: arr[%d] is %s \n", i, s) |
| 24 | v := fn(i) |
| 25 | if v != nil { |
| 26 | vv := v[0].Int() |
| 27 | if vv != 1 { |
| 28 | t.FailNow() |
| 29 | } |
| 30 | } |
| 31 | } |
| 32 | fmt.Println("print: arr is", arr) |
| 33 | for i := 0; i < len(arr); i++ { |
| 34 | print(i, arr[i], f) |
| 35 | } |
| 36 | } |
| 37 | |
| 38 | func TestBefore(t *testing.T) { |
| 39 | t.Parallel() |
nothing calls this directly
no test coverage detected
searching dependent graphs…