(t *testing.T)
| 28 | } |
| 29 | |
| 30 | func TestChain(t *testing.T) { |
| 31 | var nums []int |
| 32 | var ( |
| 33 | append1 = appendingWrapper(&nums, 1) |
| 34 | append2 = appendingWrapper(&nums, 2) |
| 35 | append3 = appendingWrapper(&nums, 3) |
| 36 | append4 = appendingJob(&nums, 4) |
| 37 | ) |
| 38 | NewChain(append1, append2, append3).Then(append4).Run() |
| 39 | if !reflect.DeepEqual(nums, []int{1, 2, 3, 4}) { |
| 40 | t.Error("unexpected order of calls:", nums) |
| 41 | } |
| 42 | } |
| 43 | |
| 44 | func TestChainRecover(t *testing.T) { |
| 45 | panickingJob := FuncJob(func() { |
nothing calls this directly
no test coverage detected