summaryrefslogtreecommitdiff
path: root/HutchTests/DeepLinkTests.swift
diff options
context:
space:
mode:
Diffstat (limited to 'HutchTests/DeepLinkTests.swift')
-rw-r--r--HutchTests/DeepLinkTests.swift26
1 files changed, 13 insertions, 13 deletions
diff --git a/HutchTests/DeepLinkTests.swift b/HutchTests/DeepLinkTests.swift
index 12f759b..c57cfce 100644
--- a/HutchTests/DeepLinkTests.swift
+++ b/HutchTests/DeepLinkTests.swift
@@ -6,61 +6,61 @@ struct DeepLinkTests {
@Test
func parsesHomeLink() {
- let link = DeepLink(url: URL(string: "hutch://home")!)
+ let link = DeepLink(url: HutchDeepLinkURL.home)
#expect(link == .home)
}
@Test
func parsesNilPathAsHome() {
- let link = DeepLink(url: URL(string: "hutch://")!)
+ let link = DeepLink(url: HutchDeepLinkURL.emptyHost)
#expect(link == .home)
}
@Test
func parsesRepositoryLink() {
- let link = DeepLink(url: URL(string: "hutch://git/~user/repo")!)
+ let link = DeepLink(url: HutchDeepLinkURL.repositoryGit)
#expect(link == .repository(owner: "~user", repo: "repo"))
}
@Test
func parsesTicketLink() {
- let link = DeepLink(url: URL(string: "hutch://todo/~owner/tracker/42")!)
+ let link = DeepLink(url: HutchDeepLinkURL.ticket)
#expect(link == .ticket(owner: "~owner", tracker: "tracker", ticketId: 42))
}
@Test
func parsesBuildJobLink() {
- let link = DeepLink(url: URL(string: "hutch://builds/12345")!)
+ let link = DeepLink(url: HutchDeepLinkURL.buildJob)
#expect(link == .build(jobId: 12345))
}
@Test
func parsesBuildsTabLink() {
- let link = DeepLink(url: URL(string: "hutch://builds")!)
+ let link = DeepLink(url: HutchDeepLinkURL.builds)
#expect(link == .buildsTab)
}
@Test
func parsesRepositoriesTabLink() {
- let link = DeepLink(url: URL(string: "hutch://repositories")!)
+ let link = DeepLink(url: HutchDeepLinkURL.repositories)
#expect(link == .repositoriesTab)
}
@Test
func parsesTrackersTabLink() {
- let link = DeepLink(url: URL(string: "hutch://trackers")!)
+ let link = DeepLink(url: HutchDeepLinkURL.trackers)
#expect(link == .trackersTab)
}
@Test
func parsesSystemStatusLink() {
- let link = DeepLink(url: URL(string: "hutch://status")!)
+ let link = DeepLink(url: HutchDeepLinkURL.status)
#expect(link == .systemStatus)
}
@Test
func parsesLookupLink() {
- let link = DeepLink(url: URL(string: "hutch://lookup")!)
+ let link = DeepLink(url: HutchDeepLinkURL.lookup)
#expect(link == .lookup)
}
@@ -72,19 +72,19 @@ struct DeepLinkTests {
@Test
func rejectsUnknownPath() {
- let link = DeepLink(url: URL(string: "hutch://unknown")!)
+ let link = DeepLink(url: HutchDeepLinkURL.unknown)
#expect(link == nil)
}
@Test
func rejectsTicketLinkWithNonNumericId() {
- let link = DeepLink(url: URL(string: "hutch://todo/~owner/tracker/abc")!)
+ let link = DeepLink(url: HutchDeepLinkURL.invalidTicketId)
#expect(link == nil)
}
@Test
func rejectsBuildLinkWithNonNumericId() {
- let link = DeepLink(url: URL(string: "hutch://builds/abc")!)
+ let link = DeepLink(url: HutchDeepLinkURL.invalidBuildId)
#expect(link == nil)
}
}