(t *testing.T)
| 22 | } |
| 23 | |
| 24 | func TestTaskNeedsRunTrue(t *testing.T) { |
| 25 | tempXDGStateDir(t) |
| 26 | |
| 27 | ran := false |
| 28 | task := &testTask{ |
| 29 | RunFunc: func(ctx context.Context) error { |
| 30 | ran = true |
| 31 | return nil |
| 32 | }, |
| 33 | NeedsRunFunc: func(context.Context, RunInfo) bool { |
| 34 | return true |
| 35 | }, |
| 36 | } |
| 37 | |
| 38 | err := Run(t.Context(), t.Name(), task) |
| 39 | if err != nil { |
| 40 | t.Error("got non-nil error:", err) |
| 41 | } |
| 42 | if !ran { |
| 43 | t.Error("got ran = false, want true") |
| 44 | } |
| 45 | } |
| 46 | |
| 47 | func TestTaskNeedsRunFalse(t *testing.T) { |
| 48 | tempXDGStateDir(t) |
nothing calls this directly
no test coverage detected