(t *testing.T)
| 45 | } |
| 46 | |
| 47 | func TestTaskNeedsRunFalse(t *testing.T) { |
| 48 | tempXDGStateDir(t) |
| 49 | |
| 50 | ran := false |
| 51 | task := &testTask{ |
| 52 | RunFunc: func(ctx context.Context) error { |
| 53 | ran = true |
| 54 | return nil |
| 55 | }, |
| 56 | NeedsRunFunc: func(context.Context, RunInfo) bool { |
| 57 | return false |
| 58 | }, |
| 59 | } |
| 60 | |
| 61 | err := Run(t.Context(), t.Name(), task) |
| 62 | if err != nil { |
| 63 | t.Error("got non-nil error:", err) |
| 64 | } |
| 65 | if ran { |
| 66 | t.Error("got ran = true, want false") |
| 67 | } |
| 68 | } |
| 69 | |
| 70 | func TestTaskLastRun(t *testing.T) { |
| 71 | tempXDGStateDir(t) |
nothing calls this directly
no test coverage detected