From 5c9d1498c30c4b4a7a37d8765d5d581f2ac34595 Mon Sep 17 00:00:00 2001 From: Kevin Lundberg Date: Wed, 24 Jul 2024 14:01:33 -0400 Subject: [PATCH] Update to latest issue reporting library --- Package.resolved | 8 +++---- Package.swift | 4 ++-- Sources/ComposableCoreLocation/Failing.swift | 24 +++++++++---------- .../Internal/Publisher+Extensions.swift | 6 ++--- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/Package.resolved b/Package.resolved index e748480..576156e 100644 --- a/Package.resolved +++ b/Package.resolved @@ -1,12 +1,12 @@ { "pins" : [ { - "identity" : "xctest-dynamic-overlay", + "identity" : "swift-issue-reporting", "kind" : "remoteSourceControl", - "location" : "https://github.com/pointfreeco/xctest-dynamic-overlay.git", + "location" : "https://github.com/pointfreeco/swift-issue-reporting.git", "state" : { - "revision" : "23cbf2294e350076ea4dbd7d5d047c1e76b03631", - "version" : "1.0.2" + "revision" : "357ca1e5dd31f613a1d43320870ebc219386a495", + "version" : "1.2.2" } } ], diff --git a/Package.swift b/Package.swift index 0e1394a..adab2de 100644 --- a/Package.swift +++ b/Package.swift @@ -18,7 +18,7 @@ let package = Package( ], dependencies: [ .package( - url: "https://github.com/pointfreeco/xctest-dynamic-overlay.git", + url: "https://github.com/pointfreeco/swift-issue-reporting.git", "0.9.0"..<"2.0.0" ), ], @@ -26,7 +26,7 @@ let package = Package( .target( name: "ComposableCoreLocation", dependencies: [ - .product(name: "XCTestDynamicOverlay", package: "xctest-dynamic-overlay"), + .product(name: "IssueReporting", package: "swift-issue-reporting"), ] ), .testTarget( diff --git a/Sources/ComposableCoreLocation/Failing.swift b/Sources/ComposableCoreLocation/Failing.swift index a69f57b..84e6131 100644 --- a/Sources/ComposableCoreLocation/Failing.swift +++ b/Sources/ComposableCoreLocation/Failing.swift @@ -1,10 +1,10 @@ import Combine import CoreLocation -import XCTestDynamicOverlay +import IssueReporting extension LocationManager { /// The failing implementation of the ``LocationManager`` interface. By default this - /// implementation stubs all of its endpoints as functions that immediately call `XCTFail`. + /// implementation stubs all of its endpoints as functions that immediately call `reportIssue`. /// /// This allows you to test an even deeper property of your features: that they use only the /// location manager endpoints that you specify and nothing else. This can be useful as a @@ -39,11 +39,11 @@ extension LocationManager { /// ``` public static let failing = Self( accuracyAuthorization: { - XCTFail("A failing endpoint was accessed: 'LocationManager.accuracyAuthorization'") + reportIssue("A failing endpoint was accessed: 'LocationManager.accuracyAuthorization'") return nil }, authorizationStatus: { - XCTFail("A failing endpoint was accessed: 'LocationManager.authorizationStatus'") + reportIssue("A failing endpoint was accessed: 'LocationManager.authorizationStatus'") return .notDetermined }, delegate: { .unimplemented("LocationManager.delegate") }, @@ -51,31 +51,31 @@ extension LocationManager { .unimplemented("LocationManager.dismissHeadingCalibrationDisplay") }, heading: { - XCTFail("A failing endpoint was accessed: 'LocationManager.heading'") + reportIssue("A failing endpoint was accessed: 'LocationManager.heading'") return nil }, headingAvailable: { - XCTFail("A failing endpoint was accessed: 'LocationManager.headingAvailable'") + reportIssue("A failing endpoint was accessed: 'LocationManager.headingAvailable'") return false }, isRangingAvailable: { - XCTFail("A failing endpoint was accessed: 'LocationManager.isRangingAvailable'") + reportIssue("A failing endpoint was accessed: 'LocationManager.isRangingAvailable'") return false }, location: { - XCTFail("A failing endpoint was accessed: 'LocationManager.location'") + reportIssue("A failing endpoint was accessed: 'LocationManager.location'") return nil }, locationServicesEnabled: { - XCTFail("A failing endpoint was accessed: 'LocationManager.locationServicesEnabled'") + reportIssue("A failing endpoint was accessed: 'LocationManager.locationServicesEnabled'") return false }, maximumRegionMonitoringDistance: { - XCTFail("A failing endpoint was accessed: 'LocationManager.maximumRegionMonitoringDistance'") + reportIssue("A failing endpoint was accessed: 'LocationManager.maximumRegionMonitoringDistance'") return CLLocationDistanceMax }, monitoredRegions: { - XCTFail("A failing endpoint was accessed: 'LocationManager.monitoredRegions'") + reportIssue("A failing endpoint was accessed: 'LocationManager.monitoredRegions'") return [] }, requestAlwaysAuthorization: { .unimplemented("LocationManager.requestAlwaysAuthorization") }, @@ -88,7 +88,7 @@ extension LocationManager { }, set: { _ in .unimplemented("LocationManager.set") }, significantLocationChangeMonitoringAvailable: { - XCTFail() + reportIssue() return false }, startMonitoringForRegion: { _ in .unimplemented("LocationManager.startMonitoringForRegion") }, diff --git a/Sources/ComposableCoreLocation/Internal/Publisher+Extensions.swift b/Sources/ComposableCoreLocation/Internal/Publisher+Extensions.swift index 6b8b742..3709459 100644 --- a/Sources/ComposableCoreLocation/Internal/Publisher+Extensions.swift +++ b/Sources/ComposableCoreLocation/Internal/Publisher+Extensions.swift @@ -1,10 +1,10 @@ import Combine -import XCTestDynamicOverlay +import IssueReporting extension AnyPublisher { - static func unimplemented(_ prefix: String, file: StaticString = #file, line: UInt = #line) -> Self { + static func unimplemented(_ prefix: String, fileID: StaticString = #fileID, filePath: StaticString = #filePath, line: UInt = #line) -> Self { .fireAndForget { - XCTFail("\(prefix.isEmpty ? "" : "\(prefix) - ")An unimplemented publisher ran.", file: file, line: line) + reportIssue("\(prefix.isEmpty ? "" : "\(prefix) - ")An unimplemented publisher ran.", fileID: fileID, filePath: filePath, line: line) } }