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 {
8181 let testIsParameterized = test. isParameterized
8282 isParameterized = testIsParameterized
8383 if testIsParameterized {
84- _testCases = test. testCases ? . map ( EncodedTestCase . init ( encoding: ) )
84+ _testCases = test. uncheckedTestCases ? . map ( EncodedTestCase . init ( encoding: ) )
8585 }
8686 }
8787 name = test. name
Original file line number Diff line number Diff line change @@ -128,6 +128,23 @@ public struct Test: Sendable {
128128 }
129129 }
130130
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+
131148 /// Evaluate this test's cases if they have not been evaluated yet.
132149 ///
133150 /// 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