Skip to content

Commit 4bac06a

Browse files
author
Ryan Dingman
committed
Update how we disable tests that require SubprocessSpan
1 parent 5f2df5f commit 4bac06a

File tree

2 files changed

+9
-15
lines changed

2 files changed

+9
-15
lines changed

Tests/SubprocessTests/SubprocessTests+Unix.swift

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -666,22 +666,8 @@ extension SubprocessUnixTests {
666666
#expect(catResult.standardError == expected)
667667
}
668668

669-
@Test(
670-
.enabled(
671-
if: {
672-
if #available(SubprocessSpan , *) {
673-
true
674-
} else {
675-
false
676-
}
677-
}(),
678-
"This test requires SubprocessSpan"
679-
)
680-
)
669+
@Test(.enabled(if: hasSubprocessSpan, "This test requires SubprocessSpan"))
681670
func testSlowDripRedirectedOutputRedirectToSequence() async throws {
682-
guard #available(SubprocessSpan , *) else {
683-
return
684-
}
685671
let threshold: Double = 0.5
686672

687673
let script = """

Tests/SubprocessTests/TestSupport.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,11 @@ internal func directory(_ lhs: String, isSameAs rhs: String) -> Bool {
4242

4343
return canonicalLhs == canonicalRhs
4444
}
45+
46+
internal var hasSubprocessSpan: Bool {
47+
if #available(SubprocessSpan , *) {
48+
true
49+
} else {
50+
false
51+
}
52+
}

0 commit comments

Comments
 (0)