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 {
39 "reputationError", "portScanError", 39 "reputationError", "portScanError",
40 ] 40 ]
41 41
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
42 private func makeEntry() -> HistoryEntry { 47 private func makeEntry() -> HistoryEntry {
43 HistoryEntry( 48 HistoryEntry(
44 identity: .init( 49 identity: .init(
@@ -54,7 +59,7 @@ final class HistoryEntryCodableTests: XCTestCase {
54 ), 59 ),
55 provenance: .init( 60 provenance: .init(
56 resolverDisplayName: "Test Resolver", 61 resolverDisplayName: "Test Resolver",
57 resolverURLString: "https://resolver.example/dns-query" 62 resolverURLString: Self.resolverURL
58 ) 63 )
59 ) 64 )
60 } 65 }
@@ -108,7 +113,7 @@ final class HistoryEntryCodableTests: XCTestCase {
108 XCTAssertEqual(object["resolverDisplayName"] as? String, "Test Resolver") 113 XCTAssertEqual(object["resolverDisplayName"] as? String, "Test Resolver")
109 XCTAssertEqual( 114 XCTAssertEqual(
110 object["resolverURLString"] as? String, 115 object["resolverURLString"] as? String,
111 "https://resolver.example/dns-query" 116 Self.resolverURL
112 ) 117 )
113 } 118 }
114 119