Skip to content

Commit dc509d5

Browse files
authored
Remove Test.underestimatedCaseCount SPI (#178)
1 parent 7d4fe42 commit dc509d5

File tree

2 files changed

+0
-61
lines changed

2 files changed

+0
-61
lines changed

Sources/Testing/Test.swift

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -53,32 +53,6 @@ public struct Test: Sendable {
5353
/// The source location of this test.
5454
public var sourceLocation: SourceLocation
5555

56-
/// The (underestimated) number of iterations that will need to occur during
57-
/// testing.
58-
///
59-
/// The value of this property is inherently capped at `Int.max`. In practice,
60-
/// the number of iterations that can run in a reasonable timespan will be
61-
/// significantly lower.
62-
///
63-
/// For instances of ``Test`` that represent non-parameterized test functions
64-
/// (that is, test functions that do not iterate over a sequence of inputs),
65-
/// the value of this property is always `1`. For instances of ``Test`` that
66-
/// represent test suite types, the value of this property is always `nil`.
67-
///
68-
/// For more information about underestimated counts, see the documentation
69-
/// for [`Sequence`](https://developer.apple.com/documentation/swift/array/underestimatedcount-4ggqp).
70-
@_spi(ExperimentalParameterizedTesting)
71-
public var underestimatedCaseCount: Int? {
72-
// NOTE: it is important that we only expose an _underestimated_ count for
73-
// two reasons:
74-
// 1. If the total number of cases exceeds `.max` due to combinatoric
75-
// complexity, `count` would be too low; and
76-
// 2. We reserve the right to support async sequences as input in the
77-
// future, and async sequences do not have `count` properties (but an
78-
// underestimated count of `0` is still technically correct.)
79-
testCases?.underestimatedCount
80-
}
81-
8256
/// The type containing this test, if any.
8357
///
8458
/// If a test is associated with a free function or static function, the value

Tests/TestingTests/MiscellaneousTests.swift

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -309,41 +309,6 @@ struct MiscellaneousTests {
309309
await valueGrid.validateCells()
310310
}
311311

312-
@Test("Test.underestimatedCaseCount property")
313-
func underestimatedCaseCount() async throws {
314-
do {
315-
let test = try #require(await testFunction(named: "parameterized(i:)", in: NonSendableTests.self))
316-
#expect(test.underestimatedCaseCount == FixtureData.zeroUpTo100.count)
317-
}
318-
do {
319-
let test = try #require(await testFunction(named: "parameterized2(i:j:)", in: NonSendableTests.self))
320-
#expect(test.underestimatedCaseCount == FixtureData.zeroUpTo100.count * FixtureData.smallStringArray.count)
321-
}
322-
do {
323-
let test = try #require(await testFunction(named: "parameterized(i:)", in: SendableTests.self))
324-
#expect(test.underestimatedCaseCount == FixtureData.zeroUpTo100.count)
325-
}
326-
#if !SWT_NO_GLOBAL_ACTORS
327-
do {
328-
let test = try #require(await testFunction(named: "parameterized(i:)", in: MainActorIsolatedTests.self))
329-
#expect(test.underestimatedCaseCount == FixtureData.zeroUpTo100.count)
330-
}
331-
do {
332-
let test = try #require(await testFunction(named: "parameterizedNonisolated(i:)", in: MainActorIsolatedTests.self))
333-
#expect(test.underestimatedCaseCount == FixtureData.zeroUpTo100.count)
334-
}
335-
#endif
336-
337-
do {
338-
let thisTest = try #require(await testFunction(named: "succeeds()", in: SendableTests.self))
339-
#expect(thisTest.underestimatedCaseCount == 1)
340-
}
341-
do {
342-
let thisTest = try #require(await test(for: SendableTests.self))
343-
#expect(thisTest.underestimatedCaseCount == nil)
344-
}
345-
}
346-
347312
@Test("Test.parameters property")
348313
func parametersProperty() async throws {
349314
do {

0 commit comments

Comments
 (0)