Skip to content

Commit

Permalink
Merge pull request #772 from Quick/remove-compiler-version-check
Browse files Browse the repository at this point in the history
Remove now-unnecessary compiler version check
  • Loading branch information
ikesyo authored May 22, 2020
2 parents e21547f + a5392a0 commit 978b6d1
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Sources/Nimble/Matchers/BeGreaterThan.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public func ><T: Comparable>(lhs: Expectation<T>, rhs: T) {
lhs.to(beGreaterThan(rhs))
}

#if canImport(Darwin) || !compiler(>=5.1)
#if canImport(Darwin)
/// A Nimble matcher that succeeds when the actual value is greater than the expected value.
public func beGreaterThan(_ expectedValue: NMBComparable?) -> Predicate<NMBComparable> {
let errorMessage = "be greater than <\(stringify(expectedValue))>"
Expand Down
2 changes: 1 addition & 1 deletion Sources/Nimble/Matchers/BeGreaterThanOrEqualTo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public func >=<T: Comparable>(lhs: Expectation<T>, rhs: T) {
lhs.to(beGreaterThanOrEqualTo(rhs))
}

#if canImport(Darwin) || !compiler(>=5.1)
#if canImport(Darwin)
/// A Nimble matcher that succeeds when the actual value is greater than
/// or equal to the expected value.
public func beGreaterThanOrEqualTo<T: NMBComparable>(_ expectedValue: T?) -> Predicate<T> {
Expand Down
2 changes: 1 addition & 1 deletion Sources/Nimble/Matchers/BeLessThan.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public func <<T: Comparable>(lhs: Expectation<T>, rhs: T) {
lhs.to(beLessThan(rhs))
}

#if canImport(Darwin) || !compiler(>=5.1)
#if canImport(Darwin)
/// A Nimble matcher that succeeds when the actual value is less than the expected value.
public func beLessThan(_ expectedValue: NMBComparable?) -> Predicate<NMBComparable> {
let message = "be less than <\(stringify(expectedValue))>"
Expand Down
2 changes: 1 addition & 1 deletion Sources/Nimble/Matchers/BeLessThanOrEqual.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public func <=<T: Comparable>(lhs: Expectation<T>, rhs: T) {
lhs.to(beLessThanOrEqualTo(rhs))
}

#if canImport(Darwin) || !compiler(>=5.1)
#if canImport(Darwin)
/// A Nimble matcher that succeeds when the actual value is less than
/// or equal to the expected value.
public func beLessThanOrEqualTo<T: NMBComparable>(_ expectedValue: T?) -> Predicate<T> {
Expand Down
7 changes: 1 addition & 6 deletions Sources/Nimble/Matchers/MatcherProtocols.swift
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,9 @@ extension NSDate: TestOutputStringConvertible {
@objc public protocol NMBComparable {
func NMB_compare(_ otherObject: NMBComparable!) -> ComparisonResult
}
#elseif !compiler(>=5.1)
// This should become obsolete once Corelibs Foundation adds Comparable conformance to NSNumber
public protocol NMBComparable {
func NMB_compare(_ otherObject: NMBComparable!) -> ComparisonResult
}
#endif

#if canImport(Darwin) || !compiler(>=5.1)
#if canImport(Darwin)
extension NSNumber: NMBComparable {
public func NMB_compare(_ otherObject: NMBComparable!) -> ComparisonResult {
// swiftlint:disable:next force_cast
Expand Down

0 comments on commit 978b6d1

Please sign in to comment.