Skip to content

Commit aecf9a3

Browse files
committed
Add tests to confirm that issue is caused by NSArray.isEqual(to:)
1 parent 95b7463 commit aecf9a3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

TestFoundation/TestNSArray.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,12 @@ class TestNSArray : XCTestCase {
421421

422422
XCTAssertFalse(array1.isEqual(nil))
423423
XCTAssertFalse(array1.isEqual(NSObject()))
424+
425+
let objectsArray1 = NSArray(array: [NSArray(array: [0])])
426+
let objectsArray2 = NSArray(array: [NSArray(array: [1])])
427+
XCTAssertFalse(objectsArray1 == objectsArray2)
428+
XCTAssertFalse(objectsArray1.isEqual(objectsArray2))
429+
XCTAssertFalse(objectsArray1.isEqual(to: Array(objectsArray2)))
424430
}
425431

426432
/// - Note: value type conversion will destroy identity. So use index(of:) instead of indexOfObjectIdentical(to:)

0 commit comments

Comments
 (0)