MCPcopy Create free account
hub / github.com/Unpackerr/unpackerr / TestFolderConfigIsExcludedPath

Function TestFolderConfigIsExcludedPath

pkg/unpackerr/folder_test.go:37–55  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

35}
36
37func TestFolderConfigIsExcludedPath(t *testing.T) {
38 t.Parallel()
39
40 base := t.TempDir()
41 excluded := filepath.Join(base, "permanent")
42 cfg := &FolderConfig{ExcludePaths: []string{excluded}}
43
44 if !cfg.isExcludedPath(excluded) {
45 t.Fatal("expected exact excluded path to match")
46 }
47
48 if !cfg.isExcludedPath(filepath.Join(excluded, "sub", "file.rar")) {
49 t.Fatal("expected child path of excluded folder to match")
50 }
51
52 if cfg.isExcludedPath(excluded + "_other") {
53 t.Fatal("did not expect prefix-only sibling path to match")
54 }
55}
56
57func TestFoldersProcessEventCurrentBehavior(t *testing.T) {
58 t.Parallel()

Callers

nothing calls this directly

Calls 1

isExcludedPathMethod · 0.95

Tested by

no test coverage detected