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

Function newTestFolders

pkg/unpackerr/folder_test.go:183–202  ·  view source on GitHub ↗
(t *testing.T, cfg *FolderConfig)

Source from the content-addressed store, hash-verified

181}
182
183func newTestFolders(t *testing.T, cfg *FolderConfig) *Folders {
184 t.Helper()
185
186 folders, err := (FoldersConfig{Buffer: 32}).newWatcher([]*FolderConfig{cfg}, noopLogger{})
187 if err != nil {
188 t.Fatalf("creating watcher: %v", err)
189 }
190
191 t.Cleanup(func() {
192 if folders.Watcher != nil {
193 folders.Watcher.Close()
194 }
195
196 if folders.FSNotify != nil {
197 _ = folders.FSNotify.Close()
198 }
199 })
200
201 return folders
202}

Calls 1

newWatcherMethod · 0.80

Tested by

no test coverage detected