mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2024-12-22 07:34:09 +01:00
Merge
This commit is contained in:
commit
6df9d1a45f
@ -56,6 +56,7 @@
|
||||
"parallelizable" : true,
|
||||
"target" : {
|
||||
"containerPath" : "container:",
|
||||
<<<<<<< HEAD
|
||||
"identifier" : "FeedlyTests",
|
||||
"name" : "FeedlyTests"
|
||||
}
|
||||
@ -66,6 +67,10 @@
|
||||
"containerPath" : "container:",
|
||||
"identifier" : "AccountTests",
|
||||
"name" : "AccountTests"
|
||||
=======
|
||||
"identifier" : "WebTests",
|
||||
"name" : "WebTests"
|
||||
>>>>>>> 72e83becb1becceba3c41a747d377a7bfab51bf4
|
||||
}
|
||||
}
|
||||
],
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"originHash" : "59328e75653678265f96b3e73fe970261384ed8254eaf879de4d37bf88c50409",
|
||||
"originHash" : "2079e49cc55bbf9be4182c1dcc315cf7f9fb85bb8df8872cfbf587882e37a80e",
|
||||
"pins" : [
|
||||
{
|
||||
"identity" : "plcrashreporter",
|
||||
|
@ -1,5 +1,5 @@
|
||||
//
|
||||
// Dictionary+RSWeb.swift
|
||||
// Dictionary+Web.swift
|
||||
// RSWeb
|
||||
//
|
||||
// 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`.
|
||||
var urlQueryString: String? {
|
||||
|
||||
var components = URLComponents()
|
||||
|
||||
components.queryItems = self.reduce(into: [URLQueryItem]()) {
|
||||
$0.append(URLQueryItem(name: $1.key, value: $1.value))
|
||||
var queryItems = [URLQueryItem]()
|
||||
for (key, value) in self {
|
||||
queryItems.append(URLQueryItem(name: key, value: value))
|
||||
}
|
||||
|
||||
var components = URLComponents()
|
||||
components.queryItems = queryItems
|
||||
let s = components.percentEncodedQuery
|
||||
|
||||
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
|
||||
}
|
||||
}
|
@ -59,6 +59,14 @@
|
||||
"identifier" : "518B2ED12351B3DD00400001",
|
||||
"name" : "NetNewsWire-iOSTests"
|
||||
}
|
||||
},
|
||||
{
|
||||
"parallelizable" : true,
|
||||
"target" : {
|
||||
"containerPath" : "container:",
|
||||
"identifier" : "WebTests",
|
||||
"name" : "WebTests"
|
||||
}
|
||||
}
|
||||
],
|
||||
"version" : 1
|
||||
|
Loading…
Reference in New Issue
Block a user