diff options
| author | Christian Cleberg <[email protected]> | 2026-05-14 12:41:55 -0500 |
|---|---|---|
| committer | Christian Cleberg <[email protected]> | 2026-05-14 12:41:55 -0500 |
| commit | 0d61e05e98f6f020722ee4d43f024c1da348d2a9 (patch) | |
| tree | b388972b86cf83de380381c52c4390c3beafc69a /HutchTests/DeepLinkTests.swift | |
| parent | f28e5cee1643e3f99d7bf90476d1dcf9347229a0 (diff) | |
| download | hutch-3.4.0.tar.gz hutch-3.4.0.tar.bz2 hutch-3.4.0.zip | |
feat: add Safari extension for sourcehut deep linksv3.4.0
Diffstat (limited to 'HutchTests/DeepLinkTests.swift')
| -rw-r--r-- | HutchTests/DeepLinkTests.swift | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/HutchTests/DeepLinkTests.swift b/HutchTests/DeepLinkTests.swift index c57cfce..500c4cd 100644 --- a/HutchTests/DeepLinkTests.swift +++ b/HutchTests/DeepLinkTests.swift @@ -19,7 +19,19 @@ struct DeepLinkTests { @Test func parsesRepositoryLink() { let link = DeepLink(url: HutchDeepLinkURL.repositoryGit) - #expect(link == .repository(owner: "~user", repo: "repo")) + #expect(link == .repository(service: .git, owner: "~user", repo: "repo")) + } + + @Test + func parsesHgRepositoryLink() { + let link = DeepLink(url: HutchDeepLinkURL.repositoryHg) + #expect(link == .repository(service: .hg, owner: "~user", repo: "repo")) + } + + @Test + func parsesServiceOwnerRootAsUserProfile() { + let link = DeepLink(url: HutchDeepLinkURL.gitOwnerRoot) + #expect(link == .userProfile(owner: "~owner")) } @Test @@ -35,6 +47,18 @@ struct DeepLinkTests { } @Test + func parsesBuildJobLinkWithOwnerPath() { + let link = DeepLink(url: HutchDeepLinkURL.buildJobWithOwner) + #expect(link == .build(jobId: 12345)) + } + + @Test + func parsesMailingListLink() { + let link = DeepLink(url: HutchDeepLinkURL.mailingList) + #expect(link == .mailingList(owner: "~owner", list: "list")) + } + + @Test func parsesBuildsTabLink() { let link = DeepLink(url: HutchDeepLinkURL.builds) #expect(link == .buildsTab) @@ -65,6 +89,12 @@ struct DeepLinkTests { } @Test + func parsesUserProfileLink() { + let link = DeepLink(url: HutchDeepLinkURL.userProfile) + #expect(link == .userProfile(owner: "~owner")) + } + + @Test func rejectsNonHutchScheme() { let link = DeepLink(url: URL(string: "https://example.com/home")!) #expect(link == nil) |
