mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Move modules to Modules folder.
This commit is contained in:
45
Modules/RSWeb/Tests/RSWebTests/DictionaryTests.swift
Normal file
45
Modules/RSWeb/Tests/RSWebTests/DictionaryTests.swift
Normal file
@@ -0,0 +1,45 @@
|
||||
//
|
||||
// DictionaryTests.swift
|
||||
// RSWebTests
|
||||
//
|
||||
// Created by Brent Simmons on 1/13/18.
|
||||
// Copyright © 2018 Ranchero Software. All rights reserved.
|
||||
//
|
||||
|
||||
import XCTest
|
||||
|
||||
class DictionaryTests: XCTestCase {
|
||||
|
||||
func testSimpleQueryString() {
|
||||
|
||||
let d = ["foo": "bar", "param1": "This is a value."]
|
||||
let s = d.urlQueryString
|
||||
|
||||
XCTAssertTrue(s == "foo=bar¶m1=This%20is%20a%20value." || s == "param1=This%20is%20a%20value.&foo=bar")
|
||||
}
|
||||
|
||||
func testQueryStringWithAmpersand() {
|
||||
|
||||
let d = ["fo&o": "bar", "param1": "This is a&value."]
|
||||
let s = d.urlQueryString
|
||||
|
||||
XCTAssertTrue(s == "fo%26o=bar¶m1=This%20is%20a%26value." || s == "param1=This%20is%20a%26value.&fo%26o=bar")
|
||||
}
|
||||
|
||||
func testQueryStringWithAccentedCharacters() {
|
||||
|
||||
let d = ["fée": "bør"]
|
||||
let s = d.urlQueryString
|
||||
|
||||
XCTAssertTrue(s == "f%C3%A9e=b%C3%B8r")
|
||||
}
|
||||
|
||||
func testQueryStringWithEmoji() {
|
||||
|
||||
let d = ["🌴e": "bar🎩🌴"]
|
||||
let s = d.urlQueryString
|
||||
|
||||
XCTAssertTrue(s == "%F0%9F%8C%B4e=bar%F0%9F%8E%A9%F0%9F%8C%B4")
|
||||
}
|
||||
|
||||
}
|
||||
42
Modules/RSWeb/Tests/RSWebTests/RSWebTests.swift
Executable file
42
Modules/RSWeb/Tests/RSWebTests/RSWebTests.swift
Executable file
@@ -0,0 +1,42 @@
|
||||
//
|
||||
// RSWebTests.swift
|
||||
// RSWebTests
|
||||
//
|
||||
// Created by Brent Simmons on 12/22/16.
|
||||
// Copyright © 2016 Ranchero Software, LLC. All rights reserved.
|
||||
//
|
||||
|
||||
import XCTest
|
||||
@testable import RSWeb
|
||||
|
||||
class RSWebTests: XCTestCase {
|
||||
|
||||
override func setUp() {
|
||||
super.setUp()
|
||||
// Put setup code here. This method is called before the invocation of each test method in the class.
|
||||
}
|
||||
|
||||
override func tearDown() {
|
||||
// Put teardown code here. This method is called after the invocation of each test method in the class.
|
||||
super.tearDown()
|
||||
}
|
||||
|
||||
func testExample() {
|
||||
// This is an example of a functional test case.
|
||||
// Use XCTAssert and related functions to verify your tests produce the correct results.
|
||||
}
|
||||
|
||||
func testPerformanceExample() {
|
||||
// This is an example of a performance test case.
|
||||
self.measure {
|
||||
// Put the code you want to measure the time of here.
|
||||
}
|
||||
}
|
||||
|
||||
func testAllBrowsers() {
|
||||
let browsers = MacWebBrowser.sortedBrowsers()
|
||||
|
||||
XCTAssertNotNil(browsers);
|
||||
}
|
||||
|
||||
}
|
||||
19
Modules/RSWeb/Tests/RSWebTests/StringTests.swift
Normal file
19
Modules/RSWeb/Tests/RSWebTests/StringTests.swift
Normal file
@@ -0,0 +1,19 @@
|
||||
//
|
||||
// StringTests.swift
|
||||
// RSWebTests
|
||||
//
|
||||
// Created by Brent Simmons on 1/13/18.
|
||||
// Copyright © 2018 Ranchero Software. All rights reserved.
|
||||
//
|
||||
|
||||
import XCTest
|
||||
|
||||
class StringTests: XCTestCase {
|
||||
|
||||
func testHTMLEscaping() {
|
||||
|
||||
let s = #"<foo>"bar"&'baz'"#.escapedHTML
|
||||
XCTAssertEqual(s, "<foo>"bar"&'baz'")
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user