Skip to content

Commit 8aeb5e7

Browse files
committed
Tests: adjust the ModuleAliasingBuildTests for Windows
The path spelling was incorrect for cross-platform cases. Adjust the test expectations to use `AbsolutePath` to resolve the spelling differences.
1 parent 1826ef6 commit 8aeb5e7

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

Tests/BuildTests/ModuleAliasingBuildTests.swift

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,8 @@ final class ModuleAliasingBuildTests: XCTestCase {
203203
}
204204

205205
func testModuleAliasingDuplicateDylibProductNames() throws {
206+
let fooPkg: AbsolutePath = "/fooPkg"
207+
let barPkg: AbsolutePath = "/barPkg"
206208
let fs = InMemoryFileSystem(
207209
emptyFiles:
208210
"/thisPkg/Sources/exe/main.swift",
@@ -215,7 +217,7 @@ final class ModuleAliasingBuildTests: XCTestCase {
215217
manifests: [
216218
Manifest.createFileSystemManifest(
217219
displayName: "fooPkg",
218-
path: "/fooPkg",
220+
path: fooPkg,
219221
products: [
220222
ProductDescription(name: "Logging", type: .library(.dynamic), targets: ["Logging"]),
221223
],
@@ -225,7 +227,7 @@ final class ModuleAliasingBuildTests: XCTestCase {
225227
),
226228
Manifest.createFileSystemManifest(
227229
displayName: "barPkg",
228-
path: "/barPkg",
230+
path: barPkg,
229231
products: [
230232
ProductDescription(name: "Logging", type: .library(.dynamic), targets: ["Logging"]),
231233
],
@@ -258,11 +260,13 @@ final class ModuleAliasingBuildTests: XCTestCase {
258260
],
259261
observabilityScope: observability.topScope
260262
)) { error in
261-
XCTAssertEqual((error as? PackageGraphError)?.description, "multiple products named 'Logging' in: 'barpkg' (at '/barPkg'), 'foopkg' (at '/fooPkg')")
263+
XCTAssertEqual((error as? PackageGraphError)?.description, "multiple products named 'Logging' in: 'barpkg' (at '\(barPkg)'), 'foopkg' (at '\(fooPkg)')")
262264
}
263265
}
264266

265267
func testModuleAliasingDuplicateDylibStaticLibProductNames() throws {
268+
let fooPkg: AbsolutePath = "/fooPkg"
269+
let barPkg: AbsolutePath = "/barPkg"
266270
let fs = InMemoryFileSystem(
267271
emptyFiles:
268272
"/thisPkg/Sources/exe/main.swift",
@@ -275,7 +279,7 @@ final class ModuleAliasingBuildTests: XCTestCase {
275279
manifests: [
276280
Manifest.createFileSystemManifest(
277281
displayName: "fooPkg",
278-
path: "/fooPkg",
282+
path: fooPkg,
279283
products: [
280284
ProductDescription(name: "Logging", type: .library(.dynamic), targets: ["Logging"]),
281285
],
@@ -285,7 +289,7 @@ final class ModuleAliasingBuildTests: XCTestCase {
285289
),
286290
Manifest.createFileSystemManifest(
287291
displayName: "barPkg",
288-
path: "/barPkg",
292+
path: barPkg,
289293
products: [
290294
ProductDescription(name: "Logging", type: .library(.static), targets: ["Logging"]),
291295
],
@@ -318,7 +322,7 @@ final class ModuleAliasingBuildTests: XCTestCase {
318322
],
319323
observabilityScope: observability.topScope
320324
)) { error in
321-
XCTAssertEqual((error as? PackageGraphError)?.description, "multiple products named 'Logging' in: 'barpkg' (at '/barPkg'), 'foopkg' (at '/fooPkg')")
325+
XCTAssertEqual((error as? PackageGraphError)?.description, "multiple products named 'Logging' in: 'barpkg' (at '\(barPkg)'), 'foopkg' (at '\(fooPkg)')")
322326
}
323327
}
324328

0 commit comments

Comments
 (0)