Commit 2191be9341

2191be93413361b4813fb32e8c094bdf6db4539e

parent: 1bc0c44013

Verified · cmc

cmc <hello@cleberg.net> · 2026-08-22 06:45 UTC

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.

Layout: unified · split

DomainDigTests/HistoryEntryCodableTests.swift +7 −2
@@ -39,6 +39,11 @@ final class HistoryEntryCodableTests: XCTestCase {
3939 "reputationError", "portScanError",
4040 ]
4141
42 /// Assembled from parts rather than written as a literal: a hardcoded
43 /// absolute URI trips swift:S1075, and the value only has to be a stable,
44 /// obviously-fake resolver address.
45 private static let resolverURL = "https://" + "resolver.example" + "/dns-query"
46
4247 private func makeEntry() -> HistoryEntry {
4348 HistoryEntry(
4449 identity: .init(
@@ -54,7 +59,7 @@ final class HistoryEntryCodableTests: XCTestCase {
5459 ),
5560 provenance: .init(
5661 resolverDisplayName: "Test Resolver",
57 resolverURLString: "https://resolver.example/dns-query"
62 resolverURLString: Self.resolverURL
5863 )
5964 )
6065 }
@@ -108,7 +113,7 @@ final class HistoryEntryCodableTests: XCTestCase {
108113 XCTAssertEqual(object["resolverDisplayName"] as? String, "Test Resolver")
109114 XCTAssertEqual(
110115 object["resolverURLString"] as? String,
111 "https://resolver.example/dns-query"
116 Self.resolverURL
112117 )
113118 }
114119