File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed
EntryPoints/ABIv0/Encoded Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ extension ABIv0 {
81
81
let testIsParameterized = test. isParameterized
82
82
isParameterized = testIsParameterized
83
83
if testIsParameterized {
84
- _testCases = test. testCases ? . map ( EncodedTestCase . init ( encoding: ) )
84
+ _testCases = test. uncheckedTestCases ? . map ( EncodedTestCase . init ( encoding: ) )
85
85
}
86
86
}
87
87
name = test. name
Original file line number Diff line number Diff line change @@ -128,6 +128,23 @@ public struct Test: Sendable {
128
128
}
129
129
}
130
130
131
+ /// Equivalent to ``testCases``, but without requiring that the test cases be
132
+ /// evaluated first.
133
+ ///
134
+ /// Most callers should not use this property and should prefer ``testCases``
135
+ /// since it will help catch logic errors in the testing library. Use this
136
+ /// property if you are interested in the test's test cases, but the test has
137
+ /// not been evaluated by an instance of ``Runner/Plan`` (e.g. if you are
138
+ /// implementing `swift test list`.)
139
+ var uncheckedTestCases : ( some Sequence < Test . Case > ) ? {
140
+ testCasesState. flatMap { testCasesState in
141
+ if case let . evaluated( testCases) = testCasesState {
142
+ return testCases
143
+ }
144
+ return nil
145
+ }
146
+ }
147
+
131
148
/// Evaluate this test's cases if they have not been evaluated yet.
132
149
///
133
150
/// The arguments of a test are captured into a closure so they can be lazily
You can’t perform that action at this time.
0 commit comments