Implement watch exclusion lists
Some checks failed
Docs / docs (push) Has been cancelled
Docs / deploy (push) Has been cancelled

Allow exclusion of directories when watching recursively.
This commit is contained in:
T. R. Bernstein
2026-03-15 22:30:10 +01:00
parent c87099e4a7
commit 134e4e152d
8 changed files with 115 additions and 25 deletions

View File

@@ -0,0 +1,17 @@
import Foundation
import Testing
@testable import Inotify
@Suite("Directory Resolver")
struct DirectoryResolverTests {
@Test func listsDirectoryTree() async throws {
try await withTempDir { dir in
let subDirectory = "\(dir)/Subfolder/Folder 01"
try FileManager.default.createDirectory(atPath: subDirectory, withIntermediateDirectories: true)
let directories = try await DirectoryResolver.resolve(dir)
#expect(directories.count == 3)
#expect(directories.map { $0.description } == [dir, "\(dir)/Subfolder", subDirectory])
}
}
}