@@ -3388,14 +3388,19 @@ final class WorkspaceTests: XCTestCase {
3388
3388
}
3389
3389
}
3390
3390
3391
- // FIXME: this is failing
3392
3391
func testPackageMirror( ) throws {
3393
3392
let sandbox = AbsolutePath ( " /tmp/ws/ " )
3394
3393
let fs = InMemoryFileSystem ( )
3395
3394
3395
+ let config = try Workspace . Configuration ( path: sandbox. appending ( component: " swiftpm " ) , fs: fs)
3396
+ config. mirrors. set ( mirrorURL: sandbox. appending ( components: " pkgs " , " Baz " ) . pathString, forURL: sandbox. appending ( components: " pkgs " , " Bar " ) . pathString)
3397
+ config. mirrors. set ( mirrorURL: sandbox. appending ( components: " pkgs " , " Baz " ) . pathString, forURL: sandbox. appending ( components: " pkgs " , " Bam " ) . pathString)
3398
+ try config. saveState ( )
3399
+
3396
3400
let workspace = try MockWorkspace (
3397
3401
sandbox: sandbox,
3398
3402
fs: fs,
3403
+ config: config,
3399
3404
roots: [
3400
3405
MockPackage (
3401
3406
name: " Foo " ,
@@ -3459,24 +3464,6 @@ final class WorkspaceTests: XCTestCase {
3459
3464
]
3460
3465
)
3461
3466
3462
- workspace. checkPackageGraph ( roots: [ " Foo " ] ) { graph, diagnostics in
3463
- PackageGraphTester ( graph) { result in
3464
- result. check ( roots: " Foo " )
3465
- result. check ( packages: " Foo " , " Dep " , " Bar " )
3466
- result. check ( targets: " Foo " , " Dep " , " Bar " )
3467
- }
3468
- XCTAssertNoDiagnostics ( diagnostics)
3469
- }
3470
- workspace. checkManagedDependencies { result in
3471
- result. check ( dependency: " Dep " , at: . checkout( . version( " 1.5.0 " ) ) )
3472
- result. check ( dependency: " Bar " , at: . checkout( . version( " 1.5.0 " ) ) )
3473
- result. check ( notPresent: " Baz " )
3474
- }
3475
-
3476
- workspace. config. mirrors. set ( mirrorURL: workspace. packagesDir. appending ( component: " Baz " ) . pathString, forURL: workspace. packagesDir. appending ( component: " Bar " ) . pathString)
3477
- workspace. config. mirrors. set ( mirrorURL: workspace. packagesDir. appending ( component: " Baz " ) . pathString, forURL: workspace. packagesDir. appending ( component: " Bam " ) . pathString)
3478
- try workspace. config. saveState ( )
3479
-
3480
3467
let deps : [ MockDependency ] = [
3481
3468
. git( name: " Bam " , requirement: . upToNextMajor( from: " 1.0.0 " ) , products: . specific( [ " Bar " ] ) ) ,
3482
3469
]
0 commit comments