From 08acd4c35032f070ab21debba69da4040894ebe0 Mon Sep 17 00:00:00 2001 From: Sho Ikeda Date: Sun, 25 Jun 2017 01:07:12 +0900 Subject: [PATCH] [gardening] Address redundant conformance warnings in Swift 4 The changes are still compatible with Swift 3.1. --- Sources/Nimble/Matchers/Equal.swift | 6 +++--- Tests/NimbleTests/Helpers/XCTestCaseProvider.swift | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Sources/Nimble/Matchers/Equal.swift b/Sources/Nimble/Matchers/Equal.swift index d9f68fabc..0adf2f539 100644 --- a/Sources/Nimble/Matchers/Equal.swift +++ b/Sources/Nimble/Matchers/Equal.swift @@ -25,7 +25,7 @@ public func equal(_ expectedValue: T?) -> Predicate { /// Values can support equal by supporting the Equatable protocol. /// /// @see beCloseTo if you want to match imprecise types (eg - floats, doubles). -public func equal(_ expectedValue: [T: C]?) -> Predicate<[T: C]> { +public func equal(_ expectedValue: [T: C]?) -> Predicate<[T: C]> { return Predicate.define("equal <\(stringify(expectedValue))>") { actualExpression, msg in let actualValue = try actualExpression.evaluate() if expectedValue == nil || actualValue == nil { @@ -201,11 +201,11 @@ public func !=(lhs: Expectation>, rhs: Set?) { lhs.toNot(equal(rhs)) } -public func ==(lhs: Expectation<[T: C]>, rhs: [T: C]?) { +public func ==(lhs: Expectation<[T: C]>, rhs: [T: C]?) { lhs.to(equal(rhs)) } -public func !=(lhs: Expectation<[T: C]>, rhs: [T: C]?) { +public func !=(lhs: Expectation<[T: C]>, rhs: [T: C]?) { lhs.toNot(equal(rhs)) } diff --git a/Tests/NimbleTests/Helpers/XCTestCaseProvider.swift b/Tests/NimbleTests/Helpers/XCTestCaseProvider.swift index 40d976019..08a67c6d6 100644 --- a/Tests/NimbleTests/Helpers/XCTestCaseProvider.swift +++ b/Tests/NimbleTests/Helpers/XCTestCaseProvider.swift @@ -22,7 +22,7 @@ public protocol XCTestCaseNameProvider { public protocol XCTestCaseProvider: XCTestCaseProviderStatic, XCTestCaseNameProvider {} -extension XCTestCaseProvider where Self: XCTestCaseProviderStatic { +extension XCTestCaseProvider { var allTestNames: [String] { return type(of: self).allTests.map({ name, _ in return name