fix: discover XPC-backed application bundles
This commit is contained in:
@@ -103,6 +103,20 @@ import Testing
|
||||
#expect(applications.map(\.url) == [alpha, display, fallback, parent].map { $0.resolvingSymlinksInPath() })
|
||||
}
|
||||
|
||||
@Test func discoveryFindsSearchableXPCAppsButNotTheirHelpersOrInvalidBundles() throws {
|
||||
let root = try temporaryDirectory()
|
||||
defer { try? FileManager.default.removeItem(at: root) }
|
||||
let passwords = try appBundle(in: root, filename: "Passwords", name: "Passwords", packageType: "XPC!")
|
||||
_ = try appBundle(in: passwords.appendingPathComponent("Contents/Helpers"),
|
||||
filename: "Helper", name: "Helper", packageType: "XPC!")
|
||||
_ = try appBundle(in: root, filename: "NoExecutable", name: "NoExecutable",
|
||||
executable: false, packageType: "XPC!")
|
||||
|
||||
let applications = ApplicationCatalog.discover(in: [root])
|
||||
#expect(applications.map(\.url) == [passwords.resolvingSymlinksInPath()])
|
||||
#expect(ApplicationSearch.results(for: "passwords", in: applications).map(\.name) == ["Passwords"])
|
||||
}
|
||||
|
||||
@Test func discoveryCanonicalizesAliasesAndAvoidsDirectorySymlinkCycles() throws {
|
||||
let root = try temporaryDirectory()
|
||||
defer { try? FileManager.default.removeItem(at: root) }
|
||||
|
||||
Reference in New Issue
Block a user