mirror of
https://github.com/samsonjs/Peekaboo.git
synced 2026-04-27 15:07:41 +00:00
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:
parent
84df333f2b
commit
8b46d11015
1 changed files with 7 additions and 1 deletions
|
|
@ -386,8 +386,14 @@ struct ApplicationFinderEdgeCaseTests {
|
||||||
@Test("Non-existent app throws error", .tags(.fast))
|
@Test("Non-existent app throws error", .tags(.fast))
|
||||||
func nonExistentAppThrowsError() {
|
func nonExistentAppThrowsError() {
|
||||||
// Test with a completely non-existent app name
|
// Test with a completely non-existent app name
|
||||||
#expect(throws: ApplicationError.notFound("XyzNonExistentApp123")) {
|
#expect {
|
||||||
_ = try ApplicationFinder.findApplication(identifier: "XyzNonExistentApp123")
|
_ = 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"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue