MCPcopy
hub / github.com/robfig/cron / TestChain

Function TestChain

chain_test.go:30–42  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

28}
29
30func 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
44func TestChainRecover(t *testing.T) {
45 panickingJob := FuncJob(func() {

Callers

nothing calls this directly

Calls 6

appendingWrapperFunction · 0.85
appendingJobFunction · 0.85
NewChainFunction · 0.85
ThenMethod · 0.80
RunMethod · 0.65
ErrorMethod · 0.65

Tested by

no test coverage detected