Skip to content
This repository has been archived by the owner on Jan 17, 2019. It is now read-only.

Don’t use XCTAssertEqual for NSIndexPath equivalence. #268

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions tests/HUBComponentModelTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -170,16 +170,16 @@ - (void)testIndexPaths
parent.children = @[childA, childB];
childB.children = @[grandchild];

XCTAssertEqual(parent.indexPath, [NSIndexPath indexPathWithIndex:0]);
XCTAssertEqualObjects(parent.indexPath, [NSIndexPath indexPathWithIndex:0]);

NSUInteger childAIndexPathArray[] = {0,0};
XCTAssertEqual(childA.indexPath, [NSIndexPath indexPathWithIndexes:childAIndexPathArray length:2]);
XCTAssertEqualObjects(childA.indexPath, [NSIndexPath indexPathWithIndexes:childAIndexPathArray length:2]);

NSUInteger childBIndexPathArray[] = {0,1};
XCTAssertEqual(childB.indexPath, [NSIndexPath indexPathWithIndexes:childBIndexPathArray length:2]);
XCTAssertEqualObjects(childB.indexPath, [NSIndexPath indexPathWithIndexes:childBIndexPathArray length:2]);

NSUInteger grandchildIndexPathArray[] = {0,1,0};
XCTAssertEqual(grandchild.indexPath, [NSIndexPath indexPathWithIndexes:grandchildIndexPathArray length:3]);
XCTAssertEqualObjects(grandchild.indexPath, [NSIndexPath indexPathWithIndexes:grandchildIndexPathArray length:3]);
}

- (void)testPropertiesThatDoNotAffectEquality
Expand Down