MCPcopy
hub / github.com/go-task/task / TestInitFile

Function TestInitFile

init_test.go:33–52  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

31}
32
33func TestInitFile(t *testing.T) {
34 t.Parallel()
35
36 const dir = "testdata/init"
37 file := filepathext.SmartJoin(dir, "Tasks.yml")
38
39 _ = os.Remove(file)
40 if _, err := os.Stat(file); err == nil {
41 t.Errorf("Tasks.yml should not exist")
42 }
43
44 if _, err := task.InitTaskfile(file); err != nil {
45 t.Error(err)
46 }
47
48 if _, err := os.Stat(file); err != nil {
49 t.Errorf("Tasks.yml should exist")
50 }
51 _ = os.Remove(file)
52}

Callers

nothing calls this directly

Calls 2

SmartJoinFunction · 0.92
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…