Make RSParser a local module.

This commit is contained in:
Brent Simmons
2024-11-09 09:37:57 -08:00
parent 7751bff896
commit e2b76c1e08
126 changed files with 37555 additions and 38 deletions

View File

@@ -0,0 +1,47 @@
//
// EntityDecodingTests.swift
// RSParserTests
//
// Created by Brent Simmons on 12/30/17.
// Copyright © 2017 Ranchero Software, LLC. All rights reserved.
//
import XCTest
import RSParser
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, "£")
}
}