Skip to content

Commit e8ad465

Browse files
committed
Fix Linux tests
1 parent 6926b4b commit e8ad465

File tree

2 files changed

+1
-12
lines changed

2 files changed

+1
-12
lines changed

Sources/ShellOut.swift

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,6 @@ private extension Process {
418418
let errorPipe = Pipe()
419419
standardError = errorPipe
420420

421-
#if !os(Linux)
422421
outputPipe.fileHandleForReading.readabilityHandler = { handler in
423422
let data = handler.availableData
424423
outputQueue.async {
@@ -434,21 +433,13 @@ private extension Process {
434433
errorHandle?.write(data)
435434
}
436435
}
437-
#endif
438436

439437
#if os(Linux)
440438
try run()
441439
#else
442440
launch()
443441
#endif
444442

445-
#if os(Linux)
446-
outputQueue.sync {
447-
outputData = outputPipe.fileHandleForReading.readDataToEndOfFile()
448-
errorData = errorPipe.fileHandleForReading.readDataToEndOfFile()
449-
}
450-
#endif
451-
452443
waitUntilExit()
453444

454445
if let handle = outputHandle, !handle.isStandard {
@@ -459,10 +450,8 @@ private extension Process {
459450
handle.closeFile()
460451
}
461452

462-
#if !os(Linux)
463453
outputPipe.fileHandleForReading.readabilityHandler = nil
464454
errorPipe.fileHandleForReading.readabilityHandler = nil
465-
#endif
466455

467456
// Block until all writes have occurred to outputData and errorData,
468457
// and then read the data back out.

Tests/ShellOutTests/ShellOutTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class ShellOutTests: XCTestCase {
7171
}
7272

7373
func testSingleCommandAtPathContainingTilde() throws {
74-
let homeContents = try shellOut(to: "ls".checked, at: "~")
74+
let homeContents = try shellOut(to: "ls".checked, arguments: ["-a"], at: "~")
7575
XCTAssertFalse(homeContents.isEmpty)
7676
}
7777

0 commit comments

Comments
 (0)