diff --git a/Modules/Parser/Tests/FeedParserTests/EntityDecodingTests.swift b/Modules/Parser/Tests/FeedParserTests/EntityDecodingTests.swift index bc55d3e91..110e698d9 100644 --- a/Modules/Parser/Tests/FeedParserTests/EntityDecodingTests.swift +++ b/Modules/Parser/Tests/FeedParserTests/EntityDecodingTests.swift @@ -21,7 +21,39 @@ class EntityDecodingTests: XCTestCase { XCTAssertEqual(decoded, "These are the times that try men's souls.") } - func testEntities() { + func testEntityAtBeginning() { + + let s = "'leading single quote" + let decoded = HTMLEntityDecoder.decodedString(s) + + XCTAssertEqual(decoded, "'leading single quote") + } + + func testEntityAtEnd() { + + let s = "trailing single quote'" + let decoded = HTMLEntityDecoder.decodedString(s) + + XCTAssertEqual(decoded, "trailing single quote'") + } + + func testEntityInMiddle() { + + let s = "entity ç in middle" + let decoded = HTMLEntityDecoder.decodedString(s) + + XCTAssertEqual(decoded, "entity ç in middle") + } + + func testMultipleEntitiesInARow() { + + let s = "çèmult……iple 'æ"entities÷♥" + let decoded = HTMLEntityDecoder.decodedString(s) + + XCTAssertEqual(decoded, "çèmult……iple 'æ\"entities÷♥") + } + + func testOnlyEntity() { var s = "…" var decoded = HTMLEntityDecoder.decodedString(s)