MCPcopy Index your code
hub / github.com/jetify-com/devbox / TestTaskNeedsRunFalse

Function TestTaskNeedsRunFalse

internal/setup/setup_test.go:47–68  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

45}
46
47func 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
70func TestTaskLastRun(t *testing.T) {
71 tempXDGStateDir(t)

Callers

nothing calls this directly

Calls 3

tempXDGStateDirFunction · 0.85
RunFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected