From 8b46d11015b1428eff29cd515bbf98e6578ac164 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sun, 8 Jun 2025 11:28:37 +0100 Subject: [PATCH] Update ApplicationFinderTests to use modern Swift Testing patterns MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 --- .../Tests/peekabooTests/ApplicationFinderTests.swift | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/peekaboo-cli/Tests/peekabooTests/ApplicationFinderTests.swift b/peekaboo-cli/Tests/peekabooTests/ApplicationFinderTests.swift index 6f82554..5996c6f 100644 --- a/peekaboo-cli/Tests/peekabooTests/ApplicationFinderTests.swift +++ b/peekaboo-cli/Tests/peekabooTests/ApplicationFinderTests.swift @@ -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" } }