Skip to content

Commit 9a2f774

Browse files
committed
Tests: make paths possible to be relative
The path representation in AbsolutePath is incorrect and stores a relative path as an absolute path (paths with leading `/` or `\` are drive relative, not absolute, absolute paths must start with `[A-Z]:` or `\\[^\]+\[^\]+\`). This adds a root directory so that the path to the manifest is not drive relative.
1 parent 786c513 commit 9a2f774

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Tests/WorkspaceTests/SourceControlPackageContainerTests.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ class SourceControlPackageContainerTests: XCTestCase {
192192
func testVprefixVersions() throws {
193193
let fs = InMemoryFileSystem()
194194

195-
let repoPath = AbsolutePath.root
195+
let repoPath = AbsolutePath.root.appending("SourceCache")
196196
let filePath = repoPath.appending("Package.swift")
197197

198198
let specifier = RepositorySpecifier(path: repoPath)
@@ -234,7 +234,7 @@ class SourceControlPackageContainerTests: XCTestCase {
234234
func testVersions() throws {
235235
let fs = InMemoryFileSystem()
236236

237-
let repoPath = AbsolutePath.root
237+
let repoPath = AbsolutePath.root.appending("SourceCache")
238238
let filePath = repoPath.appending("Package.swift")
239239

240240
let specifier = RepositorySpecifier(path: repoPath)
@@ -327,7 +327,7 @@ class SourceControlPackageContainerTests: XCTestCase {
327327
func testPreReleaseVersions() throws {
328328
let fs = InMemoryFileSystem()
329329

330-
let repoPath = AbsolutePath.root
330+
let repoPath = AbsolutePath.root.appending("SourceCache")
331331
let filePath = repoPath.appending("Package.swift")
332332

333333
let specifier = RepositorySpecifier(path: repoPath)
@@ -371,7 +371,7 @@ class SourceControlPackageContainerTests: XCTestCase {
371371
func testSimultaneousVersions() throws {
372372
let fs = InMemoryFileSystem()
373373

374-
let repoPath = AbsolutePath.root
374+
let repoPath = AbsolutePath.root.appending("SourceCache")
375375
let filePath = repoPath.appending("Package.swift")
376376

377377
let specifier = RepositorySpecifier(path: repoPath)

0 commit comments

Comments
 (0)