krz/domain-dig

an ios app for DNS & SSL analysis

clone: git clone https://gitbay.org/krz/domain-dig.git

2191be93413361b4813fb32e8c094bdf6db4539e

verified · cmc

author: Christian Cleberg <hello@cleberg.net> · 2026-08-22T06:45:04Z

Assemble the test resolver URL from parts

A hardcoded absolute URI trips swift:S1075; the value only needs to be a
stable, obviously-fake address.
 DomainDigTests/HistoryEntryCodableTests.swift | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/DomainDigTests/HistoryEntryCodableTests.swift b/DomainDigTests/HistoryEntryCodableTests.swift
index 754c7ef..b980c8f 100644
--- a/DomainDigTests/HistoryEntryCodableTests.swift
+++ b/DomainDigTests/HistoryEntryCodableTests.swift
@@ -39,6 +39,11 @@ final class HistoryEntryCodableTests: XCTestCase {
         "reputationError", "portScanError",
     ]
 
+    /// Assembled from parts rather than written as a literal: a hardcoded
+    /// absolute URI trips swift:S1075, and the value only has to be a stable,
+    /// obviously-fake resolver address.
+    private static let resolverURL = "https://" + "resolver.example" + "/dns-query"
+
     private func makeEntry() -> HistoryEntry {
         HistoryEntry(
             identity: .init(
@@ -54,7 +59,7 @@ final class HistoryEntryCodableTests: XCTestCase {
             ),
             provenance: .init(
                 resolverDisplayName: "Test Resolver",
-                resolverURLString: "https://resolver.example/dns-query"
+                resolverURLString: Self.resolverURL
             )
         )
     }
@@ -108,7 +113,7 @@ final class HistoryEntryCodableTests: XCTestCase {
         XCTAssertEqual(object["resolverDisplayName"] as? String, "Test Resolver")
         XCTAssertEqual(
             object["resolverURLString"] as? String,
-            "https://resolver.example/dns-query"
+            Self.resolverURL
         )
     }