Skip to content

armgit / peel

Public Imported from GitHub
0

Uninstall Mac apps with every file they leave behind, and see why each belongs. Free up space, fine-tune macOS, and set up Terminal.

The File Search cap test checks the order without asking the guard

Țugui Dragoșcad4fd75939d
diff --git a/Packages/PeelCore/Tests/PeelCoreTests/FileSearchTests.swift b/Packages/PeelCore/Tests/PeelCoreTests/FileSearchTests.swift
index 2b5a0277..1d5f850a 100644
--- a/Packages/PeelCore/Tests/PeelCoreTests/FileSearchTests.swift
+++ b/Packages/PeelCore/Tests/PeelCoreTests/FileSearchTests.swift
@@ -108,7 +108,8 @@ struct FileSearchTests {
}
/// `MDQuery.h` promises no order, so the results are sorted before the cap applies. Cutting first would keep
- /// an arbitrary set of files and call them the largest.
+ /// an arbitrary set of files and call them the largest. The guard allows every file here, since the order is
+ /// what is checked; `listsOnlyRegularFilesOutsideProtectedLocations` asks the real one.
@Test func keepsTheLargestFilesWhenThereAreMoreThanTheCap() throws {
let directory = try TemporaryDirectory()
let home = directory.url.appending(path: "home", directoryHint: .isDirectory)
@@ -120,7 +121,8 @@ struct FileSearchTests {
let results = FileSearch.results(
from: paths + [biggest.path(percentEncoded: false)],
- environment: SearchEnvironment(homeDirectory: home, rootDirectory: directory.url)
+ environment: SearchEnvironment(homeDirectory: home, rootDirectory: directory.url),
+ allows: { _ in true }
)
#expect(results.files.count == FileSearch.maximumResults)