Skip to content

Commit 8bf660c

Browse files
committed
Add test for failing dynamic cast
1 parent 807e415 commit 8bf660c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Tests/Foundation/Tests/TestBridging.swift

+7
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ class TestBridging : XCTestCase {
2626
static var allTests: [(String, (TestBridging) -> () throws -> Void)] {
2727
return [
2828
("testBridgedDescription", testBridgedDescription),
29+
("testDynamicCast", testExpectedToFail(testDynamicCast, "This test crashes due to some issue with dynamic cast")),
2930
]
3031
}
3132

@@ -62,4 +63,10 @@ class TestBridging : XCTestCase {
6263
XCTAssertEqual("description", c.debugDescription)
6364
#endif
6465
}
66+
67+
func testDynamicCast() throws {
68+
class TestClass {}
69+
let anyArray: Any = [TestClass()]
70+
XCTAssertNil(anyArray as? NSObject)
71+
}
6572
}

0 commit comments

Comments
 (0)