Skip to content

Commit

Permalink
fix Dictionary equality
Browse files Browse the repository at this point in the history
  • Loading branch information
NikSativa committed Jun 9, 2023
1 parent cee2487 commit 2dae71e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 2 additions & 1 deletion Source/AnyEquality.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@ private func isAnyEqual(_ lhs: Any, _ rhs: Any) -> Bool {

switch (lhsStyle, rhsStyle) {
case (.class, .class),
(.dictionary, .dictionary),
(.struct, .struct):
guard lhsMirror.subjectType == rhsMirror.subjectType else {
return false
}
return manualDictionaryEquality(lhsMirror: lhsMirror, rhsMirror: rhsMirror)
case (.dictionary, .dictionary):
return manualDictionaryEquality(lhsMirror: lhsMirror, rhsMirror: rhsMirror)
case (.enum, .enum):
guard lhsMirror.subjectType == rhsMirror.subjectType else {
return false
Expand Down
4 changes: 1 addition & 3 deletions Tests/ArgumentTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,7 @@ final class ArgumentTests: XCTestCase {

specifiedArgs = [""]
actualArgs = [NotSpryEquatable()]
XCTAssertThrowsAssertion {
_ = subjectAction()
}
XCTAssertFalse(subjectAction())

specifiedArgs = [SpryEquatableTestHelper(isEqual: true)]
actualArgs = [SpryEquatableTestHelper(isEqual: false)]
Expand Down

0 comments on commit 2dae71e

Please sign in to comment.