Skip to content

Commit 759ce02

Browse files
authored
Test cleanup: Remove an obsolete fixture suite and add .hidden to a few tests (#803)
A few small cleanups to the project's unit tests: - Remove the obsolete fixture suite type `IndependentlyRunnableTests`. The test which used to reference it has been deleted. - Add the `.hidden` trait to a few eligible `@Test` functions. ### 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.
1 parent 12727e2 commit 759ce02

File tree

3 files changed

+3
-15
lines changed

3 files changed

+3
-15
lines changed

Tests/TestingTests/ExitTestTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ private import _TestingInternals
439439
}
440440

441441
#if false // intentionally fails to compile
442-
@Test(arguments: 100 ..< 200)
442+
@Test(.hidden, arguments: 100 ..< 200)
443443
func sellIceCreamCones(count: Int) async throws {
444444
try await #require(exitsWith: .failure) {
445445
precondition(count < 10, "Too many ice cream cones")

Tests/TestingTests/MiscellaneousTests.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,11 +224,13 @@ struct TestsWithAsyncArguments {
224224
}
225225

226226
@Test(
227+
.hidden,
227228
arguments: [0] // Meaningful trivia: This line comment should be omitted during macro expansion
228229
)
229230
func parameterizedTestWithTrailingComment(value: Int) {}
230231

231232
@Suite(
233+
.hidden,
232234
.serialized // Meaningful trivia: This line comment should be omitted during macro expansion
233235
)
234236
private struct SuiteWithTraitContainingTrailingComment {}

Tests/TestingTests/PlanTests.swift

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -456,20 +456,6 @@ private struct DummyRecursiveTrait: TestTrait, SuiteTrait {
456456
}
457457
}
458458

459-
struct IndependentlyRunnableTests {
460-
struct A {
461-
@Suite(.hidden) struct B {
462-
@Test(.hidden) func c() {}
463-
struct D {
464-
@Test(.hidden) func e() {}
465-
}
466-
}
467-
@Suite(.hidden) struct F {
468-
@Test(.hidden) func g() {}
469-
}
470-
}
471-
}
472-
473459
@Suite(.hidden)
474460
struct RelativeTraitOrderingTests {
475461
@Suite(.hidden, BasicRecursiveTrait("A"))

0 commit comments

Comments
 (0)