diff --git a/Sources/Testing/Issues/Confirmation.swift b/Sources/Testing/Issues/Confirmation.swift index 2ce3f1910..b1a1d23e6 100644 --- a/Sources/Testing/Issues/Confirmation.swift +++ b/Sources/Testing/Issues/Confirmation.swift @@ -179,6 +179,22 @@ public func confirmation( return try await body(confirmation) } +/// An overload of ``confirmation(_:expectedCount:sourceLocation:_:)-9bfdc`` +/// that handles the unbounded range operator (`...`). +/// +/// This overload is necessary because `UnboundedRange` does not conform to +/// `RangeExpression`. It effectively always succeeds because any number of +/// confirmations matches, so it is marked unavailable and is not implemented. +@available(*, unavailable, message: "Unbounded range '...' has no effect when used with a confirmation.") +public func confirmation( + _ comment: Comment? = nil, + expectedCount: UnboundedRange, + sourceLocation: SourceLocation = #_sourceLocation, + _ body: (Confirmation) async throws -> R +) async rethrows -> R { + fatalError("Unsupported") +} + @_spi(Experimental) extension Confirmation { /// A protocol that describes a range expression that can be used with diff --git a/Sources/Testing/Support/Environment.swift b/Sources/Testing/Support/Environment.swift index e4441cfd9..f94d662fe 100644 --- a/Sources/Testing/Support/Environment.swift +++ b/Sources/Testing/Support/Environment.swift @@ -188,7 +188,7 @@ enum Environment { return nil case let errorCode: let error = Win32Error(rawValue: errorCode) - fatalError("unexpected error when getting environment variable '\(name)': \(error) (\(errorCode))") + fatalError("Unexpected error when getting environment variable '\(name)': \(error) (\(errorCode))") } } else if count > buffer.count { // Try again with the larger count. diff --git a/Sources/TestingMacros/Support/AvailabilityGuards.swift b/Sources/TestingMacros/Support/AvailabilityGuards.swift index 1a6fa1f05..8a628094f 100644 --- a/Sources/TestingMacros/Support/AvailabilityGuards.swift +++ b/Sources/TestingMacros/Support/AvailabilityGuards.swift @@ -118,7 +118,7 @@ private func _createAvailabilityTraitExpr( return ".__unavailable(message: \(message), sourceLocation: \(sourceLocationExpr))" default: - fatalError("Unsupported keyword \(whenKeyword) passed to \(#function)") + fatalError("Unsupported keyword \(whenKeyword) passed to \(#function). Please file a bug report at https://github.com/swiftlang/swift-testing/issues/new") } }