Skip to content

Commit f14ca6a

Browse files
committed
TestUtilities: silence warning from updated swift-tools-support-core
The `AbsolutePath.appending(_:RelativePath)` interface was deprecated in favour of `AbsolutePath(_:relativeTo:)` which allows us to anchor the relative path which is needed to properly form relative paths on Windows. This updates the API usage in swift-driver accordingly.
1 parent 5cfd593 commit f14ca6a

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

Tests/TestUtilities/Fixture.swift

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,12 @@ public enum Fixture {
2929
for file: String,
3030
on fileSystem: FileSystem = localFileSystem
3131
) -> AbsolutePath? {
32-
let packageRootPath = AbsolutePath(#file)
33-
.parentDirectory
34-
.parentDirectory
35-
.parentDirectory
36-
let fixturePath = packageRootPath
37-
.appending(component: "TestInputs")
38-
.appending(relativePath)
39-
.appending(component: file)
32+
let packageRootPath: AbsolutePath =
33+
AbsolutePath(#file).parentDirectory.parentDirectory.parentDirectory
34+
let fixturePath =
35+
AbsolutePath(relativePath.pathString,
36+
relativeTo: packageRootPath.appending(component: "TestInputs"))
37+
.appending(component: file)
4038

4139
// Check that the fixture is really there.
4240
guard fileSystem.exists(fixturePath) else {

0 commit comments

Comments
 (0)