@@ -42,6 +42,7 @@ class TestNSArray : XCTestCase {
42
42
( " test_insertObjectsAtIndexes " , test_insertObjectsAtIndexes) ,
43
43
( " test_replaceObjectsAtIndexesWithObjects " , test_replaceObjectsAtIndexesWithObjects) ,
44
44
( " test_pathsMatchingExtensions " , test_pathsMatchingExtensions) ,
45
+ ( " test_customMirror " , test_customMirror) ,
45
46
]
46
47
}
47
48
@@ -793,6 +794,22 @@ class TestNSArray : XCTestCase {
793
794
let match5 = paths. pathsMatchingExtensions ( [ " ..txt " ] )
794
795
XCTAssertEqual ( match5, [ ] )
795
796
}
797
+
798
+ func test_customMirror( ) {
799
+ let inputArray = [ " this " , " is " , " a " , " test " , " of " , " copy " , " with " , " strings " ]
800
+ let array = NSArray ( array: inputArray)
801
+ let arrayMirror = array. customMirror
802
+ dump ( arrayMirror. children)
803
+
804
+ XCTAssertEqual ( array [ 0 ] as! String , arrayMirror. descendant ( 0 ) as! String )
805
+ XCTAssertEqual ( array [ 1 ] as! String , arrayMirror. descendant ( 1 ) as! String )
806
+ XCTAssertEqual ( array [ 2 ] as! String , arrayMirror. descendant ( 2 ) as! String )
807
+ XCTAssertEqual ( array [ 3 ] as! String , arrayMirror. descendant ( 3 ) as! String )
808
+ XCTAssertEqual ( array [ 4 ] as! String , arrayMirror. descendant ( 4 ) as! String )
809
+ XCTAssertEqual ( array [ 5 ] as! String , arrayMirror. descendant ( 5 ) as! String )
810
+ XCTAssertEqual ( array [ 6 ] as! String , arrayMirror. descendant ( 6 ) as! String )
811
+ XCTAssertEqual ( array [ 7 ] as! String , arrayMirror. descendant ( 7 ) as! String )
812
+ }
796
813
797
814
private func createTestFile( _ path: String , _contents: Data ) -> String ? {
798
815
let tempDir = NSTemporaryDirectory ( ) + " TestFoundation_Playground_ " + NSUUID( ) . uuidString + " / "
0 commit comments