Skip to content

Commit

Permalink
Add test comparing to superclass
Browse files Browse the repository at this point in the history
  • Loading branch information
JosephDuffy committed Jan 28, 2024
1 parent 2227b42 commit 7d1f15d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Tests/CustomHashableTests/CustomHashableTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ final class CustomHashableTests: XCTestCase {
nsObjectSubclassProperty: "123-different",
nsObjectSubclassSubclassProperty: "456-different"
)
let value5 = NSObjectSubclass(nsObjectSubclassProperty: "123")

XCTAssertEqual(value1, value1)
XCTAssertEqual(value1.hashValue, value1.hashValue)
Expand All @@ -82,18 +83,30 @@ final class CustomHashableTests: XCTestCase {
XCTAssertEqual(value3.hashValue, value3.hashValue)
XCTAssertEqual(value4, value4)
XCTAssertEqual(value4.hashValue, value4.hashValue)
XCTAssertEqual(value5, value5)
XCTAssertEqual(value5.hashValue, value5.hashValue)
XCTAssertNotEqual(value1, value2)
XCTAssertNotEqual(value1, value3)
XCTAssertNotEqual(value1, value4)
XCTAssertNotEqual(value1, value5)
XCTAssertNotEqual(value1.hashValue, value2.hashValue)
XCTAssertNotEqual(value1.hashValue, value3.hashValue)
XCTAssertNotEqual(value1.hashValue, value4.hashValue)
XCTAssertNotEqual(value1.hashValue, value5.hashValue)
XCTAssertNotEqual(value2, value3)
XCTAssertNotEqual(value2, value4)
XCTAssertNotEqual(value2, value5)
XCTAssertNotEqual(value2.hashValue, value3.hashValue)
XCTAssertNotEqual(value2.hashValue, value4.hashValue)
XCTAssertNotEqual(value2.hashValue, value5.hashValue)
XCTAssertNotEqual(value3, value4)
XCTAssertNotEqual(value3, value5)
XCTAssertNotEqual(value3.hashValue, value4.hashValue)
XCTAssertNotEqual(value3.hashValue, value5.hashValue)
XCTAssertNotEqual(value5, value1)
XCTAssertNotEqual(value5, value2)
XCTAssertNotEqual(value5, value3)
XCTAssertNotEqual(value5, value4)
#else
throw XCTSkip("NSObject detection is only possible when ObjectiveC is available")
#endif
Expand Down

0 comments on commit 7d1f15d

Please sign in to comment.