MCPcopy
hub / github.com/perkeep/perkeep / TestOpenCamliIncludeNoFile

Function TestOpenCamliIncludeNoFile

internal/osutil/paths_test.go:68–78  ·  view source on GitHub ↗

Test for error when file doesn't exist

(t *testing.T)

Source from the content-addressed store, hash-verified

66
67// Test for error when file doesn't exist
68func TestOpenCamliIncludeNoFile(t *testing.T) {
69 // Test that error occurs if no such file
70 const notExist = "this_config_doesnt_exist.config"
71
72 t.Setenv("CAMLI_CONFIG_DIR", filepath.Join(os.TempDir(), "/x/y/z/not-exist"))
73
74 _, e := findCamliInclude(notExist)
75 if e == nil {
76 t.Errorf("Successfully opened config which doesn't exist: %v", notExist)
77 }
78}
79
80// Test for when a file exists in CWD
81func TestOpenCamliIncludeCWD(t *testing.T) {

Callers

nothing calls this directly

Calls 1

findCamliIncludeFunction · 0.85

Tested by

no test coverage detected