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

Function TestTaskNeedsRunTrue

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

Source from the content-addressed store, hash-verified

22}
23
24func 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
47func TestTaskNeedsRunFalse(t *testing.T) {
48 tempXDGStateDir(t)

Callers

nothing calls this directly

Calls 3

tempXDGStateDirFunction · 0.85
RunFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected