Skip to content

Commit

Permalink
Fix standard error test expectation for Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
eneko committed Aug 29, 2018
1 parent d20eb67 commit 6a708ec
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions Tests/SystemTests/StandardErrorTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,20 @@ import System

final class StandardErrorTests: XCTestCase {

var expectedError: String {
#if os(Linux)
return "cat: unrecognized option"
#else
return "cat: illegal option"
#endif
}

func testStandardError() throws {
XCTAssertTrue(try system(command: "cat --foobar", captureOutput: true).standardError.contains("illegal option"))
XCTAssertTrue(try system(command: "cat --foobar", captureOutput: true).standardError.contains(expectedError))
}

func testStandardErrorShell() throws {
XCTAssertTrue(try system(shell: "cat --foobar", captureOutput: true).standardError.contains("illegal option"))
XCTAssertTrue(try system(shell: "cat --foobar", captureOutput: true).standardError.contains(expectedError))
}

static var allTests = [
Expand Down

0 comments on commit 6a708ec

Please sign in to comment.