diff --git a/Mocky.xcodeproj/project.pbxproj b/Mocky.xcodeproj/project.pbxproj index 9defbfe0..4c3f47a8 100644 --- a/Mocky.xcodeproj/project.pbxproj +++ b/Mocky.xcodeproj/project.pbxproj @@ -1456,7 +1456,6 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = appletvos; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = 3; TVOS_DEPLOYMENT_TARGET = 9.0; }; @@ -1482,7 +1481,6 @@ PRODUCT_MODULE_NAME = "$(PRODUCT_NAME:c99extidentifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = appletvos; - SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = 3; TVOS_DEPLOYMENT_TARGET = 9.0; }; @@ -1508,7 +1506,6 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = appletvos; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = 3; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Mocky_Example_tvOS.app/Mocky_Example_tvOS"; TVOS_DEPLOYMENT_TARGET = 11.0; @@ -1533,7 +1530,6 @@ PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = appletvos; - SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = 3; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Mocky_Example_tvOS.app/Mocky_Example_tvOS"; TVOS_DEPLOYMENT_TARGET = 11.0; @@ -1592,6 +1588,7 @@ ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 4.0; }; name = Debug; }; @@ -1639,6 +1636,7 @@ MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 4.0; VALIDATE_PRODUCT = YES; }; name = Release; @@ -1657,7 +1655,6 @@ PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.0; }; name = Debug; }; @@ -1675,7 +1672,6 @@ PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.0; }; name = Release; }; @@ -1700,7 +1696,6 @@ PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Mocky_Example_iOS.app/Mocky_Example_iOS"; }; name = Debug; @@ -1722,7 +1717,6 @@ PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_SWIFT3_OBJC_INFERENCE = Default; - SWIFT_VERSION = 4.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Mocky_Example_iOS.app/Mocky_Example_iOS"; }; name = Release; @@ -1753,7 +1747,6 @@ PROVISIONING_PROFILE_SPECIFIER = ""; SDKROOT = macosx; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_VERSION = 4.0; }; name = Debug; }; @@ -1781,7 +1774,6 @@ PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; SDKROOT = macosx; - SWIFT_VERSION = 4.0; }; name = Release; }; @@ -1809,7 +1801,6 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_VERSION = 4.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Mocky_Example_macOS.app/Contents/MacOS/Mocky_Example_macOS"; }; name = Debug; @@ -1836,7 +1827,6 @@ PRODUCT_BUNDLE_IDENTIFIER = "com.cocoapods.org.demo.Mocky-Example-macOSTests"; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = macosx; - SWIFT_VERSION = 4.0; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Mocky_Example_macOS.app/Contents/MacOS/Mocky_Example_macOS"; }; name = Release; @@ -1877,7 +1867,6 @@ PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = YES; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -1918,7 +1907,6 @@ PRODUCT_BUNDLE_IDENTIFIER = com.swiftymocky.SwiftyMocky; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = YES; - SWIFT_VERSION = 4.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; diff --git a/Podfile.lock b/Podfile.lock index 3d32af58..d8b9633f 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -20,6 +20,6 @@ SPEC CHECKSUMS: Sourcery: d78d3b68aa565a7194e57ccd6995c1368fda9cb0 SwiftyMocky: 184fc088388e0e59cf0c0cd9288c4db885a340a1 -PODFILE CHECKSUM: 71c85b79b35b28e80d11a137d918ed3d63d9e119 +PODFILE CHECKSUM: 06778e14f0a1d260b889612657d3594731029e26 COCOAPODS: 1.5.0 diff --git a/Sources/Classes/Matcher.swift b/Sources/Classes/Matcher.swift index a81336fe..f1b12401 100644 --- a/Sources/Classes/Matcher.swift +++ b/Sources/Classes/Matcher.swift @@ -121,38 +121,38 @@ public class Matcher { register(UInt64?.self) register(Data?.self) #else - register([Bool].self) { $0 == $1 } - register([String].self) { $0 == $1 } - register([Float].self) { $0 == $1 } - register([Double].self) { $0 == $1 } - register([Character].self) { $0 == $1 } - register([Int].self) { $0 == $1 } - register([Int8].self) { $0 == $1 } - register([Int16].self) { $0 == $1 } - register([Int32].self) { $0 == $1 } - register([Int64].self) { $0 == $1 } - register([UInt].self) { $0 == $1 } - register([UInt8].self) { $0 == $1 } - register([UInt16].self) { $0 == $1 } - register([UInt32].self) { $0 == $1 } - register([UInt64].self) { $0 == $1 } - register([Data].self) { $0 == $1 } - register([Bool?].self) { $0 == $1 } - register([String?].self) { $0 == $1 } - register([Float?].self) { $0 == $1 } - register([Double?].self) { $0 == $1 } - register([Character?].self) { $0 == $1 } - register([Int?].self) { $0 == $1 } - register([Int8?].self) { $0 == $1 } - register([Int16?].self) { $0 == $1 } - register([Int32?].self) { $0 == $1 } - register([Int64?].self) { $0 == $1 } - register([UInt?].self) { $0 == $1 } - register([UInt8?].self) { $0 == $1 } - register([UInt16?].self) { $0 == $1 } - register([UInt32?].self) { $0 == $1 } - register([UInt64?].self) { $0 == $1 } - register([Data?].self) { $0 == $1 } + register([Bool].self) { (a: Bool, b: Bool) in return a == b } + register([String].self) { (a: String, b: String) in return a == b } + register([Float].self) { (a: Float, b: Float) in return a == b } + register([Double].self) { (a: Double, b: Double) in return a == b } + register([Character].self) { (a: Character, b: Character) in return a == b } + register([Int].self) { (a: Int, b: Int) in return a == b } + register([Int8].self) { (a: Int8, b: Int8) in return a == b } + register([Int16].self) { (a: Int16, b: Int16) in return a == b } + register([Int32].self) { (a: Int32, b: Int32) in return a == b } + register([Int64].self) { (a: Int64, b: Int64) in return a == b } + register([UInt].self) { (a: UInt, b: UInt) in return a == b } + register([UInt8].self) { (a: UInt8, b: UInt8) in return a == b } + register([UInt16].self) { (a: UInt16, b: UInt16) in return a == b } + register([UInt32].self) { (a: UInt32, b: UInt32) in return a == b } + register([UInt64].self) { (a: UInt64, b: UInt64) in return a == b } + register([Data].self) { (a: Data, b: Data) in return a == b } + register([Bool?].self) { (a: Bool?, b: Bool?) in return a == b } + register([String?].self) { (a: String?, b: String?) in return a == b } + register([Float?].self) { (a: Float?, b: Float?) in return a == b } + register([Double?].self) { (a: Double?, b: Double?) in return a == b } + register([Character?].self) { (a: Character?, b: Character?) in return a == b } + register([Int?].self) { (a: Int?, b: Int?) in return a == b } + register([Int8?].self) { (a: Int8?, b: Int8?) in return a == b } + register([Int16?].self) { (a: Int16?, b: Int16?) in return a == b } + register([Int32?].self) { (a: Int32?, b: Int32?) in return a == b } + register([Int64?].self) { (a: Int64?, b: Int64?) in return a == b } + register([UInt?].self) { (a: UInt?, b: UInt?) in return a == b } + register([UInt8?].self) { (a: UInt8?, b: UInt8?) in return a == b } + register([UInt16?].self) { (a: UInt16?, b: UInt16?) in return a == b } + register([UInt32?].self) { (a: UInt32?, b: UInt32?) in return a == b } + register([UInt64?].self) { (a: UInt64?, b: UInt64?) in return a == b } + register([Data?].self) { (a: Data?, b: Data?) in return a == b } #endif // Types @@ -214,7 +214,9 @@ public class Matcher { self.register(valueType, match: { _, _ in return true }) } -#if swift(>=3.2) +#if swift(>=4.1) + // Use equatable +#elseif swift(>=3.2) /// Register sequence comparator, based on elements comparing. /// /// - Parameters: