File tree Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -1332,7 +1332,7 @@ private struct ResolverDebugger<
13321332 /// This algorithm can be exponential, so we abort after the predefined time limit.
13331333 func debug(
13341334 dependencies inputDependencies: [ Constraint ] ,
1335- pins: [ Constraint ]
1335+ pins inputPins : [ Constraint ]
13361336 ) throws -> ( dependencies: [ Constraint ] , pins: [ Constraint ] ) {
13371337
13381338 // Form the dependencies array.
@@ -1353,10 +1353,12 @@ private struct ResolverDebugger<
13531353 }
13541354 }
13551355
1356- // Remove the unversioned constraints which may be added as result of the above loop.
1357- dependencies = dependencies. filter ( { dep in
1358- return !inputDependencies. contains ( where: { $0. identifier == dep. identifier && $0. requirement == . unversioned } )
1359- } )
1356+ // Form a set of all unversioned dependencies.
1357+ let unversionedDependencies = Set ( inputDependencies. filter ( { $0. requirement == . unversioned } ) . map ( { $0. identifier } ) )
1358+
1359+ // Remove the unversioned constraints from dependencies and pins.
1360+ dependencies = dependencies. filter ( { !unversionedDependencies. contains ( $0. identifier) } )
1361+ let pins = inputPins. filter ( { !unversionedDependencies. contains ( $0. identifier) } )
13601362
13611363 // Put the resolver in incomplete mode to avoid cloning new repositories.
13621364 resolver. isInIncompleteMode = true
Original file line number Diff line number Diff line change @@ -1682,12 +1682,15 @@ final class WorkspaceTests: XCTestCase {
16821682 workspace. checkManagedDependencies { result in
16831683 result. check ( dependency: " foo " , at: . edited( nil ) )
16841684 }
1685+ workspace. checkResolved ( ) { result in
1686+ result. check ( dependency: " foo " , at: . checkout( . version( " 1.0.0 " ) ) )
1687+ }
16851688
16861689 // Try resolving a bad graph.
16871690 let deps : [ TestWorkspace . PackageDependency ] = [
16881691 . init( name: " Bar " , requirement: . exact( " 1.1.0 " ) ) ,
16891692 ]
1690- workspace. checkUpdate ( roots: [ " Root " ] , deps: deps) { diagnostics in
1693+ workspace. checkPackageGraph ( roots: [ " Root " ] , deps: deps) { ( _ , diagnostics) in
16911694 DiagnosticsEngineTester ( diagnostics) { result in
16921695 result. check ( diagnostic: . contains( " /tmp/ws/pkgs/Bar @ 1.1.0 " ) , behavior: . error)
16931696 }
You can’t perform that action at this time.
0 commit comments