mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Restore EntityDecodingTests.
This commit is contained in:
@@ -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, "£")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user