Skip to content

Commit

Permalink
Add missing file and line
Browse files Browse the repository at this point in the history
  • Loading branch information
jmp committed Jan 18, 2021
1 parent 7a2b953 commit 417b3b0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Sources/AssertThat/Extensions/FloatingPoint.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ public extension Assertion where Subject: FloatingPoint {
}

@discardableResult func isNaN(file: StaticString = #filePath, line: UInt = #line) -> Self {
XCTAssertTrue(subject.isNaN)
XCTAssertTrue(subject.isNaN, file: file, line: line)
return self
}

@discardableResult func isNotNaN(file: StaticString = #filePath, line: UInt = #line) -> Self {
XCTAssertFalse(subject.isNaN)
XCTAssertFalse(subject.isNaN, file: file, line: line)
return self
}
}
12 changes: 6 additions & 6 deletions Sources/AssertThat/Extensions/Numeric.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,34 @@ import XCTest

public extension Assertion where Subject: Numeric {
@discardableResult func isZero(file: StaticString = #filePath, line: UInt = #line) -> Self {
XCTAssertEqual(subject, 0)
XCTAssertEqual(subject, 0, file: file, line: line)
return self
}

@discardableResult func isNotZero(file: StaticString = #filePath, line: UInt = #line) -> Self {
XCTAssertNotEqual(subject, 0)
XCTAssertNotEqual(subject, 0, file: file, line: line)
return self
}
}

public extension Assertion where Subject: Numeric & Comparable {
@discardableResult func isPositive(file: StaticString = #filePath, line: UInt = #line) -> Self {
XCTAssertGreaterThan(subject, 0)
XCTAssertGreaterThan(subject, 0, file: file, line: line)
return self
}

@discardableResult func isNotPositive(file: StaticString = #filePath, line: UInt = #line) -> Self {
XCTAssertLessThanOrEqual(subject, 0)
XCTAssertLessThanOrEqual(subject, 0, file: file, line: line)
return self
}

@discardableResult func isNegative(file: StaticString = #filePath, line: UInt = #line) -> Self {
XCTAssertLessThan(subject, 0)
XCTAssertLessThan(subject, 0, file: file, line: line)
return self
}

@discardableResult func isNotNegative(file: StaticString = #filePath, line: UInt = #line) -> Self {
XCTAssertGreaterThanOrEqual(subject, 0)
XCTAssertGreaterThanOrEqual(subject, 0, file: file, line: line)
return self
}
}

0 comments on commit 417b3b0

Please sign in to comment.