File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -65,6 +65,7 @@ class TestXMLParser : XCTestCase {
65
65
( " test_withData " , test_withData) ,
66
66
( " test_withDataEncodings " , test_withDataEncodings) ,
67
67
( " test_withDataOptions " , test_withDataOptions) ,
68
+ ( " test_sr9758_abortParsing " , test_sr9758_abortParsing) ,
68
69
]
69
70
}
70
71
@@ -141,4 +142,16 @@ class TestXMLParser : XCTestCase {
141
142
XCTAssertTrue ( res)
142
143
}
143
144
145
+ func test_sr9758_abortParsing( ) {
146
+ class Delegate : NSObject , XMLParserDelegate {
147
+ func parserDidStartDocument( _ parser: XMLParser ) { parser. abortParsing ( ) }
148
+ }
149
+ let xml = TestXMLParser . xmlUnderTest ( encoding: . utf8)
150
+ let parser = XMLParser ( data: xml. data ( using: . utf8) !)
151
+ let delegate = Delegate ( )
152
+ parser. delegate = delegate
153
+ XCTAssertFalse ( parser. parse ( ) )
154
+ XCTAssertNotNil ( parser. parserError)
155
+ }
156
+
144
157
}
You can’t perform that action at this time.
0 commit comments