2024-04-02 21:43:06 -07:00
|
|
|
//
|
|
|
|
|
// EntityDecodingTests.swift
|
|
|
|
|
// RSParserTests
|
|
|
|
|
//
|
|
|
|
|
// Created by Brent Simmons on 12/30/17.
|
|
|
|
|
// Copyright © 2017 Ranchero Software, LLC. All rights reserved.
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
import XCTest
|
2024-09-09 21:49:46 -07:00
|
|
|
import FeedParser
|
2024-04-02 21:43:06 -07:00
|
|
|
|
2024-09-09 21:49:46 -07:00
|
|
|
//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, "£")
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
//}
|