Update ApplicationFinderTests to use modern Swift Testing patterns

- Replace #expect(throws:) with more expressive error validation pattern
- Use #expect { } throws: { } for better error type checking
- Improve error handling in nonExistentAppThrowsError test

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Peter Steinberger 2025-06-08 11:28:37 +01:00
parent 84df333f2b
commit 8b46d11015

View file

@ -386,8 +386,14 @@ struct ApplicationFinderEdgeCaseTests {
@Test("Non-existent app throws error", .tags(.fast))
func nonExistentAppThrowsError() {
// Test with a completely non-existent app name
#expect(throws: ApplicationError.notFound("XyzNonExistentApp123")) {
#expect {
_ = try ApplicationFinder.findApplication(identifier: "XyzNonExistentApp123")
} throws: { error in
guard let appError = error as? ApplicationError,
case let .notFound(identifier) = appError else {
return false
}
return identifier == "XyzNonExistentApp123"
}
}