summaryrefslogtreecommitdiff
path: root/HutchTests/DeepLinkTests.swift
diff options
context:
space:
mode:
authorChristian Cleberg <[email protected]>2026-05-14 12:41:55 -0500
committerChristian Cleberg <[email protected]>2026-05-14 12:41:55 -0500
commit0d61e05e98f6f020722ee4d43f024c1da348d2a9 (patch)
treeb388972b86cf83de380381c52c4390c3beafc69a /HutchTests/DeepLinkTests.swift
parentf28e5cee1643e3f99d7bf90476d1dcf9347229a0 (diff)
downloadhutch-0d61e05e98f6f020722ee4d43f024c1da348d2a9.tar.gz
hutch-0d61e05e98f6f020722ee4d43f024c1da348d2a9.tar.bz2
hutch-0d61e05e98f6f020722ee4d43f024c1da348d2a9.zip
feat: add Safari extension for sourcehut deep linksv3.4.0
Diffstat (limited to 'HutchTests/DeepLinkTests.swift')
-rw-r--r--HutchTests/DeepLinkTests.swift32
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)