Skip to content

Commit 7cb5040

Browse files
committed
I am not clever
1 parent 1df6ba4 commit 7cb5040

File tree

1 file changed

+3
-16
lines changed

1 file changed

+3
-16
lines changed

Tests/TestingTests/Support/FileHandleTests.swift

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -203,24 +203,11 @@ struct FileHandleTests {
203203
#endif
204204

205205
@Test("Root directory path is correct")
206-
func rootDirectoryPathIsCorrect() async {
206+
func rootDirectoryPathIsCorrect() throws {
207207
#if os(Windows)
208-
#if !SWT_NO_EXIT_TESTS
209-
await #expect(processExitsWith: .success) {
210-
#expect(Environment.setVariable(nil, named: "SYSTEMDRIVE"))
211-
#expect(rootDirectoryPath == #"C:\"#)
212-
}
213-
214-
await #expect(processExitsWith: .success) {
215-
#expect(Environment.setVariable("Q:", named: "SYSTEMDRIVE"))
216-
#expect(rootDirectoryPath == #"Q:\"#)
208+
if let systemDrive = Environment.variable(named: "SYSTEMDRIVE") {
209+
#expect(rootDirectoryPath.starts(with: systemDrive))
217210
}
218-
219-
await #expect(processExitsWith: .success) {
220-
#expect(Environment.setVariable(#"Q:\abc123"#, named: "SYSTEMDRIVE"))
221-
#expect(rootDirectoryPath == #"Q:\abc123\"#)
222-
}
223-
#endif
224211
#else
225212
#expect(rootDirectoryPath == "/")
226213
#endif

0 commit comments

Comments
 (0)