Skip to content

Commit 2f0cd63

Browse files
authored
Merge pull request #1603 from swiftlang/jgrynspan/171579639-revert-1598
Revert "Replace fixture protocol in ConfirmationTests with an existential composition of parameterized protocols (#1598)" This reverts commit d63cbd4. Resolves rdar://171579639. ### Checklist: - [x] Code and documentation should follow the style of the [Style Guide](https://github.com/apple/swift-testing/blob/main/Documentation/StyleGuide.md). - [x] If public symbols are renamed or modified, DocC references should be updated.
2 parents 568d9aa + 2ead04f commit 2f0cd63

File tree

3 files changed

+3
-27
lines changed

3 files changed

+3
-27
lines changed

Package.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,6 @@ extension Array where Element == PackageDescription.SwiftSetting {
422422
.enableExperimentalFeature("AvailabilityMacro=_clockAPI:macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0"),
423423
.enableExperimentalFeature("AvailabilityMacro=_typedThrowsAPI:macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0"),
424424
.enableExperimentalFeature("AvailabilityMacro=_castingWithNonCopyableGenerics:macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0"),
425-
.enableExperimentalFeature("AvailabilityMacro=_compositionOfParameterizedProtocols:macOS 26.4, iOS 26.4, watchOS 26.4, tvOS 26.4, visionOS 26.4"),
426425

427426
.enableExperimentalFeature("AvailabilityMacro=_distantFuture:macOS 99.0, iOS 99.0, watchOS 99.0, tvOS 99.0, visionOS 99.0"),
428427
]

Tests/TestingTests/ConfirmationTests.swift

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,7 @@ struct ConfirmationTests {
3333

3434
@Test("Unsuccessful confirmations")
3535
func unsuccessfulConfirmations() async {
36-
// confirmedOutOfRange(_:) is availability-guarded, but if it runs, increase
37-
// the number of expected miscounts by the number of arguments passed to it.
38-
var expectedCount = 7
39-
if #available(_compositionOfParameterizedProtocols, *) {
40-
expectedCount += 4
41-
}
42-
43-
await confirmation("Miscount recorded", expectedCount: expectedCount) { miscountRecorded in
36+
await confirmation("Miscount recorded", expectedCount: 7) { miscountRecorded in
4437
var configuration = Configuration()
4538
configuration.eventHandler = { event, _ in
4639
if case let .issueRecorded(issue) = event.kind {
@@ -159,28 +152,13 @@ struct UnsuccessfulConfirmationTests {
159152
}
160153
}
161154

162-
// FIXME: Remove this test once the deployment targets are greater than or
163-
// equal to the versions specified in `_compositionOfParameterizedProtocols`.
164155
@Test(.hidden, arguments: [
165156
1 ... 2 as any ExpectedCount,
166157
1 ..< 2,
167158
1 ..< 3,
168159
999...,
169160
])
170-
func confirmedOutOfRange_legacy(_ range: any ExpectedCount) async {
171-
await confirmation(expectedCount: range) { (thingHappened) async in
172-
thingHappened(count: 3)
173-
}
174-
}
175-
176-
@Test(.hidden, arguments: [
177-
1 ... 2 as any RangeExpression<Int> & Sequence<Int> & Sendable,
178-
1 ..< 2,
179-
1 ..< 3,
180-
999...,
181-
])
182-
@available(_compositionOfParameterizedProtocols, *)
183-
func confirmedOutOfRange(_ range: any RangeExpression<Int> & Sequence<Int> & Sendable) async {
161+
func confirmedOutOfRange(_ range: any ExpectedCount) async {
184162
await confirmation(expectedCount: range) { (thingHappened) async in
185163
thingHappened(count: 3)
186164
}
@@ -190,7 +168,7 @@ struct UnsuccessfulConfirmationTests {
190168
// MARK: -
191169

192170
/// Needed since we don't have generic test functions, so we need a concrete
193-
/// argument type for `confirmedOutOfRange_legacy(_:)`. Although we can now write
171+
/// argument type for `confirmedOutOfRange(_:)`. Although we can now write
194172
/// `any RangeExpression<Int> & Sequence<Int> & Sendable` as of Swift 6.2
195173
/// (per [swiftlang/swift#76705](https://github.com/swiftlang/swift/pull/76705)),
196174
/// attempting to form an array of such values crashes at runtime. ([163980446](rdar://163980446))

cmake/modules/shared/AvailabilityDefinitions.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,4 @@ add_compile_options(
1414
"SHELL:$<$<COMPILE_LANGUAGE:Swift>:-Xfrontend -define-availability -Xfrontend \"_clockAPI:macOS 13.0, iOS 16.0, watchOS 9.0, tvOS 16.0\">"
1515
"SHELL:$<$<COMPILE_LANGUAGE:Swift>:-Xfrontend -define-availability -Xfrontend \"_typedThrowsAPI:macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0\">"
1616
"SHELL:$<$<COMPILE_LANGUAGE:Swift>:-Xfrontend -define-availability -Xfrontend \"_castingWithNonCopyableGenerics:macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0\">"
17-
"SHELL:$<$<COMPILE_LANGUAGE:Swift>:-Xfrontend -define-availability -Xfrontend \"_compositionOfParameterizedProtocols:macOS 26.4, iOS 26.4, watchOS 26.4, tvOS 26.4, visionOS 26.4\">"
1817
"SHELL:$<$<COMPILE_LANGUAGE:Swift>:-Xfrontend -define-availability -Xfrontend \"_distantFuture:macOS 99.0, iOS 99.0, watchOS 99.0, tvOS 99.0, visionOS 99.0\">")

0 commit comments

Comments
 (0)