Skip to content

Test cleanup: Remove an obsolete fixture suite and add .hidden to a few tests #803

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Tests/TestingTests/ExitTestTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ private import _TestingInternals
}

#if false // intentionally fails to compile
@Test(arguments: 100 ..< 200)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be clear, this test doesn't ever compile. It's useful when testing exit tests to verify what happens if you attempt to close over some state.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, understood. Despite being compiled out, without this trait it can still be included in the indexer's test discovery.

@Test(.hidden, arguments: 100 ..< 200)
func sellIceCreamCones(count: Int) async throws {
try await #require(exitsWith: .failure) {
precondition(count < 10, "Too many ice cream cones")
Expand Down
2 changes: 2 additions & 0 deletions Tests/TestingTests/MiscellaneousTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -224,11 +224,13 @@ struct TestsWithAsyncArguments {
}

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

@Suite(
.hidden,
.serialized // Meaningful trivia: This line comment should be omitted during macro expansion
)
private struct SuiteWithTraitContainingTrailingComment {}
Expand Down
14 changes: 0 additions & 14 deletions Tests/TestingTests/PlanTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -456,20 +456,6 @@ private struct DummyRecursiveTrait: TestTrait, SuiteTrait {
}
}

struct IndependentlyRunnableTests {
struct A {
@Suite(.hidden) struct B {
@Test(.hidden) func c() {}
struct D {
@Test(.hidden) func e() {}
}
}
@Suite(.hidden) struct F {
@Test(.hidden) func g() {}
}
}
}

@Suite(.hidden)
struct RelativeTraitOrderingTests {
@Suite(.hidden, BasicRecursiveTrait("A"))
Expand Down