mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2025-01-03 05:21:55 +01:00
Add first Web test. Add WebTests to test plans.
This commit is contained in:
parent
ad61c01ad4
commit
72e83becb1
@ -51,6 +51,14 @@
|
|||||||
"identifier" : "CoreTests",
|
"identifier" : "CoreTests",
|
||||||
"name" : "CoreTests"
|
"name" : "CoreTests"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"parallelizable" : true,
|
||||||
|
"target" : {
|
||||||
|
"containerPath" : "container:",
|
||||||
|
"identifier" : "WebTests",
|
||||||
|
"name" : "WebTests"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"version" : 1
|
"version" : 1
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"originHash" : "59328e75653678265f96b3e73fe970261384ed8254eaf879de4d37bf88c50409",
|
"originHash" : "2079e49cc55bbf9be4182c1dcc315cf7f9fb85bb8df8872cfbf587882e37a80e",
|
||||||
"pins" : [
|
"pins" : [
|
||||||
{
|
{
|
||||||
"identity" : "plcrashreporter",
|
"identity" : "plcrashreporter",
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// Dictionary+RSWeb.swift
|
// Dictionary+Web.swift
|
||||||
// RSWeb
|
// RSWeb
|
||||||
//
|
//
|
||||||
// Created by Brent Simmons on 1/13/18.
|
// Created by Brent Simmons on 1/13/18.
|
||||||
@ -13,12 +13,13 @@ public extension Dictionary where Key == String, Value == String {
|
|||||||
/// Translates a dictionary into a string like `foo=bar¶m2=some%20thing`.
|
/// Translates a dictionary into a string like `foo=bar¶m2=some%20thing`.
|
||||||
var urlQueryString: String? {
|
var urlQueryString: String? {
|
||||||
|
|
||||||
var components = URLComponents()
|
var queryItems = [URLQueryItem]()
|
||||||
|
for (key, value) in self {
|
||||||
components.queryItems = self.reduce(into: [URLQueryItem]()) {
|
queryItems.append(URLQueryItem(name: key, value: value))
|
||||||
$0.append(URLQueryItem(name: $1.key, value: $1.value))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var components = URLComponents()
|
||||||
|
components.queryItems = queryItems
|
||||||
let s = components.percentEncodedQuery
|
let s = components.percentEncodedQuery
|
||||||
|
|
||||||
return s == nil || s!.isEmpty ? nil : s
|
return s == nil || s!.isEmpty ? nil : s
|
20
Web/Tests/WebTests/DictionaryWebTests.swift
Normal file
20
Web/Tests/WebTests/DictionaryWebTests.swift
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
//
|
||||||
|
// DictionaryWebTests.swift
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// Created by Brent Simmons on 5/20/24.
|
||||||
|
//
|
||||||
|
|
||||||
|
import XCTest
|
||||||
|
import Web
|
||||||
|
|
||||||
|
final class DictionaryWebTests: XCTestCase {
|
||||||
|
|
||||||
|
func testURLQueryString_oneItemNoEscaping() {
|
||||||
|
|
||||||
|
let d = ["parameterName" : "value"]
|
||||||
|
let queryString = d.urlQueryString
|
||||||
|
let expectedQueryString = "parameterName=value"
|
||||||
|
XCTAssertEqual(queryString, expectedQueryString)
|
||||||
|
}
|
||||||
|
}
|
@ -1,12 +0,0 @@
|
|||||||
import XCTest
|
|
||||||
@testable import Web
|
|
||||||
|
|
||||||
final class WebTests: XCTestCase {
|
|
||||||
func testExample() throws {
|
|
||||||
// XCTest Documentation
|
|
||||||
// https://developer.apple.com/documentation/xctest
|
|
||||||
|
|
||||||
// Defining Test Cases and Test Methods
|
|
||||||
// https://developer.apple.com/documentation/xctest/defining_test_cases_and_test_methods
|
|
||||||
}
|
|
||||||
}
|
|
@ -35,6 +35,14 @@
|
|||||||
"identifier" : "TreeTests",
|
"identifier" : "TreeTests",
|
||||||
"name" : "TreeTests"
|
"name" : "TreeTests"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"parallelizable" : true,
|
||||||
|
"target" : {
|
||||||
|
"containerPath" : "container:",
|
||||||
|
"identifier" : "WebTests",
|
||||||
|
"name" : "WebTests"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"version" : 1
|
"version" : 1
|
||||||
|
Loading…
Reference in New Issue
Block a user