File tree Expand file tree Collapse file tree
packages/phpunit/src/Interpreter/Resolvers Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -134,6 +134,7 @@ function resolveDatasets(sources: AstNode[]): string[] {
134134 return cartesianProduct ( datasets ) ;
135135 }
136136
137+ // Cartesian failed (e.g. closure/generator can't be statically resolved); fall back to independent resolution
137138 return sources . flatMap ( ( source ) => resolvePestLabels ( source ) ) ;
138139}
139140
@@ -168,20 +169,13 @@ function deduplicateLabels(labels: string[]): string[] {
168169 counts . set ( label , ( counts . get ( label ) ?? 0 ) + 1 ) ;
169170 }
170171
171- const duplicates = new Set < string > ( ) ;
172- for ( const [ label , count ] of counts ) {
173- if ( count > 1 ) {
174- duplicates . add ( label ) ;
175- }
176- }
177-
178- if ( duplicates . size === 0 ) {
172+ if ( [ ...counts . values ( ) ] . every ( ( c ) => c === 1 ) ) {
179173 return labels ;
180174 }
181175
182176 const indices = new Map < string , number > ( ) ;
183177 return labels . map ( ( label ) => {
184- if ( ! duplicates . has ( label ) ) {
178+ if ( ( counts . get ( label ) ?? 0 ) <= 1 ) {
185179 return label ;
186180 }
187181 const idx = ( indices . get ( label ) ?? 0 ) + 1 ;
You can’t perform that action at this time.
0 commit comments