@@ -45,6 +45,7 @@ class TestNSArray : XCTestCase {
45
45
( " test_replaceObjectsAtIndexesWithObjects " , test_replaceObjectsAtIndexesWithObjects) ,
46
46
( " test_pathsMatchingExtensions " , test_pathsMatchingExtensions) ,
47
47
( " test_arrayUsedAsCFArrayInvokesArrayMethods " , test_arrayUsedAsCFArrayInvokesArrayMethods) ,
48
+ ( " test_customMirror " , test_customMirror) ,
48
49
]
49
50
}
50
51
@@ -796,6 +797,20 @@ class TestNSArray : XCTestCase {
796
797
let match5 = paths. pathsMatchingExtensions ( [ " ..txt " ] )
797
798
XCTAssertEqual ( match5, [ ] )
798
799
}
800
+
801
+ func test_customMirror( ) {
802
+ let inputArray = [ " this " , " is " , " a " , " test " , " of " , " custom " , " mirror " ]
803
+ let array = NSArray ( array: inputArray)
804
+ let arrayMirror = array. customMirror
805
+
806
+ XCTAssertEqual ( array [ 0 ] as! String , arrayMirror. descendant ( 0 ) as! String )
807
+ XCTAssertEqual ( array [ 1 ] as! String , arrayMirror. descendant ( 1 ) as! String )
808
+ XCTAssertEqual ( array [ 2 ] as! String , arrayMirror. descendant ( 2 ) as! String )
809
+ XCTAssertEqual ( array [ 3 ] as! String , arrayMirror. descendant ( 3 ) as! String )
810
+ XCTAssertEqual ( array [ 4 ] as! String , arrayMirror. descendant ( 4 ) as! String )
811
+ XCTAssertEqual ( array [ 5 ] as! String , arrayMirror. descendant ( 5 ) as! String )
812
+ XCTAssertEqual ( array [ 6 ] as! String , arrayMirror. descendant ( 6 ) as! String )
813
+ }
799
814
800
815
func test_arrayUsedAsCFArrayInvokesArrayMethods( ) {
801
816
let number = 789 as NSNumber
0 commit comments