diff --git a/RxTests/XCTest+Rx.swift b/RxTests/XCTest+Rx.swift index 51608db6..481b78c7 100644 --- a/RxTests/XCTest+Rx.swift +++ b/RxTests/XCTest+Rx.swift @@ -16,7 +16,7 @@ require specifying `self.*`, they are made global. //extension XCTestCase { /** Factory method for an `.Next` event recorded at a given time with a given value. - + - parameter time: Recorded virtual time the `.Next` event occurs. - parameter element: Next sequence element. - returns: Recorded event in time. @@ -27,7 +27,7 @@ require specifying `self.*`, they are made global. /** Factory method for an `.Completed` event recorded at a given time. - + - parameter time: Recorded virtual time the `.Completed` event occurs. - parameter type: Sequence elements type. - returns: Recorded event in time. @@ -38,7 +38,7 @@ require specifying `self.*`, they are made global. /** Factory method for an `.Error` event recorded at a given time with a given error. - + - parameter time: Recorded virtual time the `.Completed` event occurs. */ public func error(time: TestTime, _ error: ErrorType, _ type: T.Type = T.self) -> Recorded> { @@ -48,7 +48,7 @@ require specifying `self.*`, they are made global. import XCTest /** -Asserts two lists of events are equal. +Asserts two lists of events are equal. Event is considered equal if: * `Next` events are equal if they have equal corresponding elements. @@ -61,7 +61,11 @@ Event is considered equal if: public func XCTAssertEqual(lhs: [Event], _ rhs: [Event], file: String = __FILE__, line: UInt = __LINE__) { let leftEquatable = lhs.map { AnyEquatable(target: $0, comparer: ==) } let rightEquatable = rhs.map { AnyEquatable(target: $0, comparer: ==) } - XCTAssertEqual(leftEquatable, rightEquatable, file: file, line: line) + #if os(Linux) + XCTAssertEqual(leftEquatable, rightEquatable) + #else + XCTAssertEqual(leftEquatable, rightEquatable, file: file, line: line) + #endif if leftEquatable == rightEquatable { return } @@ -85,7 +89,11 @@ Event is considered equal if: public func XCTAssertEqual(lhs: [Recorded>], _ rhs: [Recorded>], file: String = __FILE__, line: UInt = __LINE__) { let leftEquatable = lhs.map { AnyEquatable(target: $0, comparer: ==) } let rightEquatable = rhs.map { AnyEquatable(target: $0, comparer: ==) } - XCTAssertEqual(leftEquatable, rightEquatable, file: file, line: line) + #if os(Linux) + XCTAssertEqual(leftEquatable, rightEquatable) + #else + XCTAssertEqual(leftEquatable, rightEquatable, file: file, line: line) + #endif if leftEquatable == rightEquatable { return @@ -112,4 +120,4 @@ func printSequenceDifferences(lhs: [E], _ rhs: [E], _ equal: (E, E) -> Bool) for (index, element) in rhs[shortest ..< rhs.count].enumerate() { print("rhs[\(index + shortest)]:\n \(element)") } -} \ No newline at end of file +}