Skip to content

Commit

Permalink
completed cleanup script for GraphQL.
Browse files Browse the repository at this point in the history
  • Loading branch information
TizianoCoroneo committed Feb 2, 2024
1 parent 96af407 commit 21616ac
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-docc-plugin",
"state" : {
"revision" : "10bc670db657d11bdd561e07de30a9041311b2b1",
"version" : "1.1.0"
"revision" : "26ac5758409154cc448d7ab82389c520fa8a8247",
"version" : "1.3.0"
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import PackageDescription
let package = Package(
name: "Deeplink",
platforms: [
.iOS(.v9),
.iOS(.v13),
.macOS(.v10_10),
],
products: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
Now we need to make a template that describes how to parse the information from a link.

This time, we'll use a keypath to our `[String]` property, and pass an additional argument to tell the system what separator should we use to parse the arguments.

As before, the data present in the URL at the location where the keypath is inserted will be assigned to the property indicated by the keypath; each item in its own String object.

@Code(name: "Defining Deeplink Data Lists.swift", file: "AddingADeeplinkList 2.swift")
Expand Down
4 changes: 2 additions & 2 deletions Sources/Deeplink/SampleDeeplink.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public struct SampleDeeplink<Value> {
/// - deeplinkTemplate: The deeplink template that you want to test. It is recommended to pass the exact same template instance that you use in your `DeeplinkCenter` to avoid having to manually keep them in sync.
/// - urlToParse: The test URL that you want to use for testing.
/// - assigningToInstance: The instance of the object to which assign the values of the parsed parameters.
/// - expectation: A closure where you should declare an expectation to fulfill, using `XCTestCase.expectation(description:)`.
/// - expectation: A closure where you should declare an expectation to fulfill, using ``XCTest/XCTestCase/expectation(description:)``.
/// - assertions: A closure that you can use to verify the correctness of the parsed parameters.
public init(
deeplinkTemplate: Deeplink<Value>,
Expand Down Expand Up @@ -67,7 +67,7 @@ public extension SampleDeeplink where Value == Void {
/// - Parameters:
/// - deeplinkTemplate: The deeplink template that you want to test. It is recommended to pass the exact same template instance that you use in your `DeeplinkCenter` to avoid having to manually keep them in sync.
/// - urlToParse: The test URL that you want to use for testing.
/// - expectation: A closure where you should declare an expectation to fulfill, using `XCTestCase.expectation(description:)`.
/// - expectation: A closure where you should declare an expectation to fulfill, using ``XCTest/XCTestCase/expectation(description:)``.
init(
deeplinkTemplate: Deeplink<Value>,
urlToParse: URL,
Expand Down
7 changes: 6 additions & 1 deletion Tests/DeeplinkTests/URLPatternMatcherTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,15 @@ class URLPathDataTests: XCTestCase {
data)
}

func testURLPathDataInitializerThrowsForInvalidComponents() {
func testURLPathDataInitializerThrowsForInvalidComponents() throws {

if #available(iOS 17, *) {
throw XCTSkip()
}

/// `a://@@` conforms to RFC 1808 (passing the URL initializer), but not to RFC 3986, necessary for `URLComponents` to work.
/// https://stackoverflow.com/questions/55609012/what-kind-of-url-is-not-conforming-to-rfc-3986-but-is-conforming-to-rfc-1808-rf
/// UPDATE: iOS 17's `URL` initializer does not accept this URL anymore. I have no idea what RFC is in effect now.
let url: URL = "a://@@"

XCTAssertThrowsError(
Expand Down

0 comments on commit 21616ac

Please sign in to comment.