(t *testing.T)
| 157 | } |
| 158 | |
| 159 | func TestFoldersHandleFileEventExcludedPath(t *testing.T) { |
| 160 | t.Parallel() |
| 161 | |
| 162 | watchPath := t.TempDir() |
| 163 | excluded := filepath.Join(watchPath, "permanent") |
| 164 | |
| 165 | folders := &Folders{ |
| 166 | Config: []*FolderConfig{{ |
| 167 | Path: watchPath, |
| 168 | ExcludePaths: []string{excluded}, |
| 169 | }}, |
| 170 | Events: make(chan *eventData, 1), |
| 171 | Logs: noopLogger{}, |
| 172 | } |
| 173 | |
| 174 | folders.handleFileEvent(filepath.Join(excluded, "file.rar"), "test") |
| 175 | |
| 176 | select { |
| 177 | case event := <-folders.Events: |
| 178 | t.Fatalf("did not expect event for excluded path: %+v", event) |
| 179 | default: |
| 180 | } |
| 181 | } |
| 182 | |
| 183 | func newTestFolders(t *testing.T, cfg *FolderConfig) *Folders { |
| 184 | t.Helper() |
nothing calls this directly
no test coverage detected