Skip to content

Commit

Permalink
Nimble: delete deprecated MatcherProtocol based matchers.
Browse files Browse the repository at this point in the history
  • Loading branch information
arangato committed Sep 21, 2020
1 parent 04b29f7 commit b2acdf4
Show file tree
Hide file tree
Showing 9 changed files with 0 additions and 385 deletions.
16 changes: 0 additions & 16 deletions Nimble.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,8 @@
1F1871E11CA89EF600A34BF2 /* NMBExceptionCapture.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F1871BE1CA89EDB00A34BF2 /* NMBExceptionCapture.h */; settings = {ATTRIBUTES = (Public, ); }; };
1F1871E21CA89EF600A34BF2 /* NMBStringify.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F1871C01CA89EDB00A34BF2 /* NMBStringify.h */; settings = {ATTRIBUTES = (Public, ); }; };
1F1871E41CA89FB600A34BF2 /* Async.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1F1871E31CA89FB600A34BF2 /* Async.swift */; };
1F1871E61CA89FCD00A34BF2 /* MatcherFunc.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1F1871E51CA89FCD00A34BF2 /* MatcherFunc.swift */; };
1F1871E71CA8A18400A34BF2 /* Async.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1F1871E31CA89FB600A34BF2 /* Async.swift */; };
1F1871E81CA8A18400A34BF2 /* Async.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1F1871E31CA89FB600A34BF2 /* Async.swift */; };
1F1871E91CA8A18700A34BF2 /* MatcherFunc.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1F1871E51CA89FCD00A34BF2 /* MatcherFunc.swift */; };
1F1871EB1CA8A18800A34BF2 /* MatcherFunc.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1F1871E51CA89FCD00A34BF2 /* MatcherFunc.swift */; };
1F1A742F1940169200FFFC47 /* Nimble.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F1A742E1940169200FFFC47 /* Nimble.h */; settings = {ATTRIBUTES = (Public, ); }; };
1F1A74351940169200FFFC47 /* Nimble.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1F1A74291940169200FFFC47 /* Nimble.framework */; };
1F1B5AD41963E13900CA8BF9 /* BeAKindOfTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1F1B5AD31963E13900CA8BF9 /* BeAKindOfTest.swift */; };
Expand Down Expand Up @@ -357,9 +354,6 @@
B20058C620E92CE400C1264D /* ElementsEqualTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = B20058C420E92CE400C1264D /* ElementsEqualTest.swift */; };
B20058C720E92CE400C1264D /* ElementsEqualTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = B20058C420E92CE400C1264D /* ElementsEqualTest.swift */; };
CD3D9A79232647BC00802581 /* CwlCatchBadInstructionPosix.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD3D9A78232647BC00802581 /* CwlCatchBadInstructionPosix.swift */; };
CD4C8F092464365300A7BDE0 /* SynchronousDeprecatedTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD4C8F082464365300A7BDE0 /* SynchronousDeprecatedTest.swift */; };
CD4C8F0A2464365300A7BDE0 /* SynchronousDeprecatedTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD4C8F082464365300A7BDE0 /* SynchronousDeprecatedTest.swift */; };
CD4C8F0B2464365300A7BDE0 /* SynchronousDeprecatedTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = CD4C8F082464365300A7BDE0 /* SynchronousDeprecatedTest.swift */; };
CD79C99E1D2CC832004B6F9A /* ObjCAsyncTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 1F4A56651A3B305F009E1637 /* ObjCAsyncTest.m */; };
CD79C99F1D2CC835004B6F9A /* ObjCSyncTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 1F8A37AF1B7C5042001C8357 /* ObjCSyncTest.m */; };
CD79C9A01D2CC839004B6F9A /* ObjCBeAnInstanceOfTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 1F4A56691A3B3108009E1637 /* ObjCBeAnInstanceOfTest.m */; };
Expand Down Expand Up @@ -514,7 +508,6 @@
1F1871C31CA89EDB00A34BF2 /* NMBObjCMatcher.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NMBObjCMatcher.swift; sourceTree = "<group>"; };
1F1871CD1CA89EE000A34BF2 /* ExceptionCapture.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ExceptionCapture.swift; sourceTree = "<group>"; };
1F1871E31CA89FB600A34BF2 /* Async.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Async.swift; sourceTree = "<group>"; };
1F1871E51CA89FCD00A34BF2 /* MatcherFunc.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MatcherFunc.swift; sourceTree = "<group>"; };
1F1A74291940169200FFFC47 /* Nimble.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Nimble.framework; sourceTree = BUILT_PRODUCTS_DIR; };
1F1A742D1940169200FFFC47 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
1F1A742E1940169200FFFC47 /* Nimble.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Nimble.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -630,7 +623,6 @@
B20058C020E92C7500C1264D /* ElementsEqual.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ElementsEqual.swift; sourceTree = "<group>"; };
B20058C420E92CE400C1264D /* ElementsEqualTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ElementsEqualTest.swift; sourceTree = "<group>"; };
CD3D9A78232647BC00802581 /* CwlCatchBadInstructionPosix.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CwlCatchBadInstructionPosix.swift; sourceTree = "<group>"; };
CD4C8F082464365300A7BDE0 /* SynchronousDeprecatedTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SynchronousDeprecatedTest.swift; sourceTree = "<group>"; };
CDBC39B82462EA7D00069677 /* PredicateTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PredicateTest.swift; sourceTree = "<group>"; };
CDC157902511957100EAA480 /* DSLTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DSLTest.swift; sourceTree = "<group>"; };
CDFB6A1E1F7E07C600AD8CC7 /* CwlCatchException.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CwlCatchException.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -787,7 +779,6 @@
CDC157902511957100EAA480 /* DSLTest.swift */,
CDBC39B82462EA7D00069677 /* PredicateTest.swift */,
1F0648D31963AAB2001F9C46 /* SynchronousTest.swift */,
CD4C8F082464365300A7BDE0 /* SynchronousDeprecatedTest.swift */,
1F925EE5195C121200ED456B /* AsynchronousTest.swift */,
965B0D0B1B62C06D0005AE66 /* UserDescriptionTest.swift */,
6CAEDD091CAEA86F003F1584 /* LinuxSupport.swift */,
Expand Down Expand Up @@ -887,7 +878,6 @@
1FD8CD1C1968AB07008ED995 /* Equal.swift */,
472FD1341B9E085700C7B8DA /* HaveCount.swift */,
DDB4D5EC19FE43C200E9D9FE /* Match.swift */,
1F1871E51CA89FCD00A34BF2 /* MatcherFunc.swift */,
1FD8CD1D1968AB07008ED995 /* MatcherProtocols.swift */,
AE7ADE441C80BF8000B94CD3 /* MatchError.swift */,
1FCF91521C61C8A400B15DCB /* PostNotification.swift */,
Expand Down Expand Up @@ -1377,7 +1367,6 @@
1FD8CD441968AB07008ED995 /* BeginWith.swift in Sources */,
1FD8CD4A1968AB07008ED995 /* BeIdenticalTo.swift in Sources */,
1FE661581E6574E30035F243 /* ExpectationMessage.swift in Sources */,
1F1871E61CA89FCD00A34BF2 /* MatcherFunc.swift in Sources */,
1FD8CD421968AB07008ED995 /* BeEmpty.swift in Sources */,
1F1871E41CA89FB600A34BF2 /* Async.swift in Sources */,
1F1871CA1CA89EDB00A34BF2 /* NMBStringify.m in Sources */,
Expand Down Expand Up @@ -1433,7 +1422,6 @@
1F925EF9195C175000ED456B /* BeNilTest.swift in Sources */,
CDC157922511957100EAA480 /* DSLTest.swift in Sources */,
7A6AB2C31E7F547E00A2F694 /* ToSucceedTest.swift in Sources */,
CD4C8F0A2464365300A7BDE0 /* SynchronousDeprecatedTest.swift in Sources */,
A8A3B707207368F000E25A08 /* ObjCSatisfyAllOfTest.m in Sources */,
1F4A56701A3B319F009E1637 /* ObjCBeCloseToTest.m in Sources */,
1F4A56971A3B34AA009E1637 /* ObjCEndWithTest.m in Sources */,
Expand Down Expand Up @@ -1520,7 +1508,6 @@
1F5DF16D1BDCA0F500C3A531 /* AdapterProtocols.swift in Sources */,
1F5DF17B1BDCA0F500C3A531 /* BeginWith.swift in Sources */,
1F5DF17E1BDCA0F500C3A531 /* BeIdenticalTo.swift in Sources */,
1F1871E91CA8A18700A34BF2 /* MatcherFunc.swift in Sources */,
1F5DF17A1BDCA0F500C3A531 /* BeEmpty.swift in Sources */,
1F5DF18C1BDCA0F500C3A531 /* Await.swift in Sources */,
1F1871D81CA89EEF00A34BF2 /* NMBStringify.m in Sources */,
Expand Down Expand Up @@ -1574,7 +1561,6 @@
1F5DF1921BDCA10200C3A531 /* AsynchronousTest.swift in Sources */,
CDC157932511957100EAA480 /* DSLTest.swift in Sources */,
1F5DF1A91BDCA10200C3A531 /* MatchTest.swift in Sources */,
CD4C8F0B2464365300A7BDE0 /* SynchronousDeprecatedTest.swift in Sources */,
A8A3B708207368F100E25A08 /* ObjCSatisfyAllOfTest.m in Sources */,
1F5DF1A81BDCA10200C3A531 /* HaveCountTest.swift in Sources */,
1F5DF1971BDCA10200C3A531 /* AllPassTest.swift in Sources */,
Expand Down Expand Up @@ -1664,7 +1650,6 @@
1FD8CD491968AB07008ED995 /* BeGreaterThanOrEqualTo.swift in Sources */,
1FE661571E6574E30035F243 /* ExpectationMessage.swift in Sources */,
1FD8CD451968AB07008ED995 /* BeginWith.swift in Sources */,
1F1871EB1CA8A18800A34BF2 /* MatcherFunc.swift in Sources */,
1FD8CD4B1968AB07008ED995 /* BeIdenticalTo.swift in Sources */,
1FD8CD431968AB07008ED995 /* BeEmpty.swift in Sources */,
1F1871D41CA89EEE00A34BF2 /* NMBStringify.m in Sources */,
Expand Down Expand Up @@ -1720,7 +1705,6 @@
1F4A56771A3B3253009E1637 /* ObjCBeGreaterThanTest.m in Sources */,
CDC157912511957100EAA480 /* DSLTest.swift in Sources */,
1F925EFA195C175000ED456B /* BeNilTest.swift in Sources */,
CD4C8F092464365300A7BDE0 /* SynchronousDeprecatedTest.swift in Sources */,
7A6AB2C21E7F547E00A2F694 /* ToSucceedTest.swift in Sources */,
A8A3B706207368EF00E25A08 /* ObjCSatisfyAllOfTest.m in Sources */,
1F4A56711A3B319F009E1637 /* ObjCBeCloseToTest.m in Sources */,
Expand Down
42 changes: 0 additions & 42 deletions Sources/Nimble/Expectation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -64,48 +64,6 @@ public struct Expectation<T> {
handler.assert(pass, message: message, location: expression.location)
}

////////////////// OLD API /////////////////////

/// DEPRECATED: Tests the actual value using a matcher to match.
@available(*, deprecated, message: "Use Predicate instead")
@discardableResult
public func to<U>(_ matcher: U, description: String? = nil) -> Self
where U: Matcher, U.ValueType == T {
let (pass, msg) = execute(
expression,
.toMatch,
matcher.predicate,
to: "to",
description: description,
captureExceptions: false
)
verify(pass, msg)
return self
}

/// DEPRECATED: Tests the actual value using a matcher to not match.
@available(*, deprecated, message: "Use Predicate instead")
@discardableResult
public func toNot<U>(_ matcher: U, description: String? = nil) -> Self
where U: Matcher, U.ValueType == T {
// swiftlint:disable:next line_length
let (pass, msg) = expressionDoesNotMatch(expression, matcher: matcher, toNot: "to not", description: description)
verify(pass, msg)
return self
}

/// DEPRECATED: Tests the actual value using a matcher to not match.
///
/// Alias to toNot().
@available(*, deprecated, message: "Use Predicate instead")
@discardableResult
public func notTo<U>(_ matcher: U, description: String? = nil) -> Self
where U: Matcher, U.ValueType == T {
return toNot(matcher, description: description)
}

////////////////// NEW API /////////////////////

/// Tests the actual value using a matcher to match.
@discardableResult
public func to(_ predicate: Predicate<T>, description: String? = nil) -> Self {
Expand Down
5 changes: 0 additions & 5 deletions Sources/Nimble/Matchers/AllPass.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ public func allPass<S: Sequence>(
return createPredicate(matcher)
}

@available(*, deprecated, message: "Use Predicate instead")
public func allPass<S: Sequence, M: Matcher>(_ elementMatcher: M) -> Predicate<S> where S.Element == M.ValueType {
return createPredicate(elementMatcher.predicate)
}

public func allPass<S: Sequence>(_ elementPredicate: Predicate<S.Element>) -> Predicate<S> {
return createPredicate(elementPredicate)
}
Expand Down
72 changes: 0 additions & 72 deletions Sources/Nimble/Matchers/Async.swift
Original file line number Diff line number Diff line change
Expand Up @@ -115,75 +115,3 @@ extension Expectation {
return toEventuallyNot(predicate, timeout: timeout, pollInterval: pollInterval, description: description)
}
}

@available(*, deprecated, message: "Use Predicate instead")
extension Expectation {
/// Tests the actual value using a matcher to match by checking continuously
/// at each pollInterval until the timeout is reached.
///
/// @discussion
/// This function manages the main run loop (`NSRunLoop.mainRunLoop()`) while this function
/// is executing. Any attempts to touch the run loop may cause non-deterministic behavior.
public func toEventually<U>(_ matcher: U, timeout: DispatchTimeInterval = AsyncDefaults.timeout, pollInterval: DispatchTimeInterval = AsyncDefaults.pollInterval, description: String? = nil)
where U: Matcher, U.ValueType == T {
if expression.isClosure {
let (pass, msg) = execute(
expression,
.toMatch,
async(
style: .toMatch,
predicate: matcher.predicate,
timeout: timeout,
poll: pollInterval,
fnName: "toEventually"
),
to: "to eventually",
description: description,
captureExceptions: false
)
verify(pass, msg)
} else {
verify(false, toEventuallyRequiresClosureError)
}
}

/// Tests the actual value using a matcher to not match by checking
/// continuously at each pollInterval until the timeout is reached.
///
/// @discussion
/// This function manages the main run loop (`NSRunLoop.mainRunLoop()`) while this function
/// is executing. Any attempts to touch the run loop may cause non-deterministic behavior.
public func toEventuallyNot<U>(_ matcher: U, timeout: DispatchTimeInterval = AsyncDefaults.timeout, pollInterval: DispatchTimeInterval = AsyncDefaults.pollInterval, description: String? = nil)
where U: Matcher, U.ValueType == T {
if expression.isClosure {
let (pass, msg) = expressionDoesNotMatch(
expression,
matcher: async(
style: .toNotMatch,
predicate: matcher.predicate,
timeout: timeout,
poll: pollInterval,
fnName: "toEventuallyNot"
),
toNot: "to eventually not",
description: description
)
verify(pass, msg)
} else {
verify(false, toEventuallyRequiresClosureError)
}
}

/// Tests the actual value using a matcher to not match by checking
/// continuously at each pollInterval until the timeout is reached.
///
/// Alias of toEventuallyNot()
///
/// @discussion
/// This function manages the main run loop (`NSRunLoop.mainRunLoop()`) while this function
/// is executing. Any attempts to touch the run loop may cause non-deterministic behavior.
public func toNotEventually<U>(_ matcher: U, timeout: DispatchTimeInterval = AsyncDefaults.timeout, pollInterval: DispatchTimeInterval = AsyncDefaults.pollInterval, description: String? = nil)
where U: Matcher, U.ValueType == T {
return toEventuallyNot(matcher, timeout: timeout, pollInterval: pollInterval, description: description)
}
}
87 changes: 0 additions & 87 deletions Sources/Nimble/Matchers/MatcherFunc.swift

This file was deleted.

Loading

0 comments on commit b2acdf4

Please sign in to comment.