From 6391cbd546d68ba9d1c130de90fc15217e318d8d Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Mon, 23 Oct 2023 16:06:49 -0700 Subject: [PATCH] Tests: avoid abnormal exit on failure Rather than using the forced unwrap, use `XCTUnwrap` to allow the test suite to continue in the case of a failure. --- Tests/WorkspaceTests/WorkspaceTests.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/WorkspaceTests/WorkspaceTests.swift b/Tests/WorkspaceTests/WorkspaceTests.swift index bf3111721c2..6f778296413 100644 --- a/Tests/WorkspaceTests/WorkspaceTests.swift +++ b/Tests/WorkspaceTests/WorkspaceTests.swift @@ -5017,7 +5017,7 @@ final class WorkspaceTests: XCTestCase { do { let ws = try workspace.getOrCreateWorkspace() let pinsStore = try ws.pinsStore.load() - let fooPin = pinsStore.pins.values.first(where: { $0.packageRef.identity.description == "foo" })! + let fooPin = try XCTUnwrap(pinsStore.pins.values.first(where: { $0.packageRef.identity.description == "foo" })) let fooRepo = workspace.repositoryProvider .specifierMap[RepositorySpecifier(path: try AbsolutePath(