diff --git a/Tests/SystemTests/StandardErrorTests.swift b/Tests/SystemTests/StandardErrorTests.swift index d2725de..b9a97d9 100644 --- a/Tests/SystemTests/StandardErrorTests.swift +++ b/Tests/SystemTests/StandardErrorTests.swift @@ -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 = [