@@ -7416,6 +7416,7 @@ final class WorkspaceTests: XCTestCase {
7416
7416
let fs = InMemoryFileSystem()
7417
7417
let sandbox = AbsolutePath("/tmp/ws/")
7418
7418
try fs.createDirectory(sandbox, recursive: true)
7419
+ let artifactUrl = "https://a.com/a.zip"
7419
7420
7420
7421
let httpClient = LegacyHTTPClient(handler: { request, _, completion in
7421
7422
do {
@@ -7446,7 +7447,7 @@ final class WorkspaceTests: XCTestCase {
7446
7447
MockTarget(
7447
7448
name: "A1",
7448
7449
type: .binary,
7449
- url: "https://a.com/a.zip" ,
7450
+ url: artifactUrl ,
7450
7451
checksum: "a1"
7451
7452
),
7452
7453
]
@@ -7471,7 +7472,17 @@ final class WorkspaceTests: XCTestCase {
7471
7472
// make sure artifact downloaded is deleted
7472
7473
XCTAssertTrue(fs.isDirectory(AbsolutePath("/tmp/ws/.build/artifacts/root")))
7473
7474
XCTAssertFalse(fs.exists(AbsolutePath("/tmp/ws/.build/artifacts/root/a.zip")))
7474
- XCTAssertFalse(fs.exists(AbsolutePath("/home/user/caches/org.swift.swiftpm/artifacts/https___a_com_a_zip")))
7475
+
7476
+ // make sure the cached artifact is also deleted
7477
+ let artifactCacheKey = artifactUrl.spm_mangledToC99ExtendedIdentifier()
7478
+ guard let cachePath = workspace.workspaceLocation?
7479
+ .sharedBinaryArtifactsCacheDirectory?
7480
+ .appending(artifactCacheKey) else {
7481
+ XCTFail("Required workspace location wasn't found")
7482
+ return
7483
+ }
7484
+
7485
+ XCTAssertFalse(fs.exists(cachePath))
7475
7486
}
7476
7487
7477
7488
func testArtifactDownloaderOrArchiverError() throws {
0 commit comments