@@ -11,7 +11,7 @@ import XCTest
1111
1212final class HTMLStringToParsedResultProcessorTests : XCTestCase {
1313 func testNormalProcess( ) {
14- let result = HTMLStringToParsedResultProcessor ( ) . process ( from: NSAttributedString ( string: " Test<a href= \" https://zhgchg.li/about?g=f#hey \" style= \" color:red \" >Hello<b>ssss</a>Zhg</b>chgli<br>.<br/>C<br />B " ) )
14+ let result = HTMLStringToParsedResultProcessor ( ) . process ( from: NSAttributedString ( string: " Test<a href= \" https://zhgchg.li/about?g=f#hey \" style= \" color:red \" custom-attribute= \" true \" >Hello<b>ssss</a>Zhg</b>chgli<br>.<br/>C<br />B " ) )
1515 let items = result. items
1616 XCTAssertEqual ( items. count, 15 , " Should have 15 elements. " )
1717 XCTAssertEqual ( result. needFormatter, true , " Should have need formatter. " )
@@ -27,9 +27,10 @@ final class HTMLStringToParsedResultProcessorTests: XCTestCase {
2727 case 1 :
2828 if case let HTMLParsedResult . start( startItem) = item {
2929 XCTAssertEqual ( startItem. tagName, " a " , " expected `a` tag at index: \( index) . " )
30- XCTAssertEqual ( startItem. attributes? . count, 2 , " expected 2 attributes in `a` tag at index: \( index) . " )
30+ XCTAssertEqual ( startItem. attributes? . count, 3 , " expected 3 attributes in `a` tag at index: \( index) . " )
3131 XCTAssertEqual ( startItem. attributes ? [ " href " ] , " https://zhgchg.li/about?g=f#hey " , " expected href attribute in `a` tag at index: \( index) . " )
3232 XCTAssertEqual ( startItem. attributes ? [ " style " ] , " color:red " , " expected style attribute in `a` tag at index: \( index) . " )
33+ XCTAssertEqual ( startItem. attributes ? [ " custom-attribute " ] , " true " , " expected custom-attribute attribute in `a` tag at index: \( index) . " )
3334 } else {
3435 XCTFail ( " expected a tag at index: \( index) . " )
3536 }
0 commit comments