Skip to content

Commit 2acac32

Browse files
authored
Merge pull request #1008 from Kyle-Ye/optimize/kyle/closure_test_case
Add ConditionTraitTests to cover the Swift 6.0 compiler issue for custom trait + closure + macro
2 parents c447de0 + 7d33b87 commit 2acac32

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
//
2+
// This source file is part of the Swift.org open source project
3+
//
4+
// Copyright (c) 2025 Apple Inc. and the Swift project authors
5+
// Licensed under Apache License v2.0 with Runtime Library Exception
6+
//
7+
// See https://swift.org/LICENSE.txt for license information
8+
// See https://swift.org/CONTRIBUTORS.txt for Swift project authors
9+
//
10+
11+
@testable import Testing
12+
13+
@Suite("Condition Trait Tests", .tags(.traitRelated))
14+
struct ConditionTraitTests {
15+
#if compiler(>=6.1)
16+
@Test(
17+
".enabled trait",
18+
.enabled { true },
19+
.bug("https://github.com/swiftlang/swift/issues/76409", "Verify the custom trait with closure causes @Test macro to fail is fixed")
20+
)
21+
func enabledTraitClosure() throws {}
22+
#endif
23+
24+
@Test(
25+
".enabled if trait",
26+
.enabled(if: true)
27+
)
28+
func enabledTraitIf() throws {}
29+
30+
#if compiler(>=6.1)
31+
@Test(
32+
".disabled trait",
33+
.disabled { false },
34+
.bug("https://github.com/swiftlang/swift/issues/76409", "Verify the custom trait with closure causes @Test macro to fail is fixed")
35+
)
36+
func disabledTraitClosure() throws {}
37+
#endif
38+
39+
@Test(
40+
".disabled if trait",
41+
.disabled(if: false)
42+
)
43+
func disabledTraitIf() throws {}
44+
}

0 commit comments

Comments
 (0)