Skip to content

Commit

Permalink
Minor patches
Browse files Browse the repository at this point in the history
  • Loading branch information
stevapple committed Dec 21, 2020
1 parent 740edef commit 556d422
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/TSCBasic/Process.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import class Foundation.ProcessInfo

#if os(Windows)
import Foundation
import WinSDK.core.sysinfo
import WinSDK
#endif

@_implementationOnly import TSCclibc
Expand Down
9 changes: 9 additions & 0 deletions Tests/TSCBasicTests/ProcessTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,17 @@ class ProcessTests: XCTestCase {
""")

// Create a non-executable file to test.
let tempNonExecutable = tmpdir.appending(component: "program.bc")
try localFileSystem.writeFileContents(tempNonExecutable, bytes: """
@echo off
exit
""")

try withCustomEnv(["PATH": tmpdir.pathString]) {
XCTAssertNotNil(Process.findExecutable("program.bat"))
XCTAssertNil(Process.findExecutable("program.bc"))
}
}
#endif
Expand Down

0 comments on commit 556d422

Please sign in to comment.