diff --git a/Modules/Parser/Tests/FeedParserTests/EntityDecodingTests.swift b/Modules/Parser/Tests/FeedParserTests/EntityDecodingTests.swift index 7a2ea1cb4..bc55d3e91 100644 --- a/Modules/Parser/Tests/FeedParserTests/EntityDecodingTests.swift +++ b/Modules/Parser/Tests/FeedParserTests/EntityDecodingTests.swift @@ -7,41 +7,40 @@ // import XCTest -import FeedParser +import SAX -//class EntityDecodingTests: XCTestCase { -// -// func test39Decoding() { -// -// // Bug found by Manton Reece — the ' entity was not getting decoded by NetNewsWire in JSON Feeds from micro.blog. -// -// let s = "These are the times that try men's souls." -// let decoded = s.rsparser_stringByDecodingHTMLEntities() -// -// XCTAssertEqual(decoded, "These are the times that try men's souls.") -// } -// -// func testEntities() { -// var s = "…" -// var decoded = s.rsparser_stringByDecodingHTMLEntities() -// -// XCTAssertEqual(decoded, "…") -// -// s = "…" -// decoded = s.rsparser_stringByDecodingHTMLEntities() -// XCTAssertEqual(decoded, "…") -// -// s = "'" -// decoded = s.rsparser_stringByDecodingHTMLEntities() -// XCTAssertEqual(decoded, "'") -// -// s = "§" -// decoded = s.rsparser_stringByDecodingHTMLEntities() -// XCTAssertEqual(decoded, "§") -// -// s = "£" -// decoded = s.rsparser_stringByDecodingHTMLEntities() -// XCTAssertEqual(decoded, "£") -// -// } -//} +class EntityDecodingTests: XCTestCase { + + func test39Decoding() { + + // Bug found by Manton Reece — the ' entity was not getting decoded by NetNewsWire in JSON Feeds from micro.blog. + + let s = "These are the times that try men's souls." + let decoded = HTMLEntityDecoder.decodedString(s) + + XCTAssertEqual(decoded, "These are the times that try men's souls.") + } + + func testEntities() { + var s = "…" + var decoded = HTMLEntityDecoder.decodedString(s) + + XCTAssertEqual(decoded, "…") + + s = "…" + decoded = HTMLEntityDecoder.decodedString(s) + XCTAssertEqual(decoded, "…") + + s = "'" + decoded = HTMLEntityDecoder.decodedString(s) + XCTAssertEqual(decoded, "'") + + s = "§" + decoded = HTMLEntityDecoder.decodedString(s) + XCTAssertEqual(decoded, "§") + + s = "£" + decoded = HTMLEntityDecoder.decodedString(s) + XCTAssertEqual(decoded, "£") + } +}