Skip to content

Commit ecdc811

Browse files
authored
Merge pull request #1089 from compnerd/relativity
Tests: ensure that the path will be relative
2 parents dffa61d + 5bde380 commit ecdc811

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

Tests/SwiftDriverTests/SwiftDriverTests.swift

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -303,10 +303,11 @@ final class SwiftDriverTests: XCTestCase {
303303
#if os(Windows)
304304
throw XCTSkip("TSCUtility.RelativePath failure")
305305
#else
306-
try withTemporaryDirectory { path in
307-
guard let cwd = localFileSystem.currentWorkingDirectory else {
308-
fatalError()
309-
}
306+
guard let cwd = localFileSystem.currentWorkingDirectory else {
307+
fatalError()
308+
}
309+
310+
try withTemporaryDirectory(dir: cwd, removeTreeOnDeinit: true) { path in
310311
let main = path.appending(component: "main.swift")
311312
let util = path.appending(component: "util.swift")
312313
let utilRelative = util.relative(to: cwd)
@@ -1134,10 +1135,11 @@ final class SwiftDriverTests: XCTestCase {
11341135
#if os(Windows)
11351136
throw XCTSkip("TSCUtility.RelativePath failure")
11361137
#else
1137-
try withTemporaryDirectory { path in
1138-
guard let cwd = localFileSystem.currentWorkingDirectory else {
1139-
fatalError()
1140-
}
1138+
guard let cwd = localFileSystem.currentWorkingDirectory else {
1139+
fatalError()
1140+
}
1141+
1142+
try withTemporaryDirectory(dir: cwd, removeTreeOnDeinit: true) { path in
11411143
let outputFileMap = path.appending(component: "outputFileMap.json")
11421144
try localFileSystem.writeFileContents(outputFileMap) {
11431145
$0 <<< """

0 commit comments

Comments
 (0)