Skip to content

Commit 621b10e

Browse files
authored
Merge pull request #14 from ipinfo/silvano/eng-548-fix-swift-library-tests
Fix tests failing because of location change
2 parents 49a54d0 + 226ebc5 commit 621b10e

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

Tests/ipinfoKitTests/IPInfoLiteTests.swift

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,20 @@ struct IPInfoLiteTests {
1010

1111
let response = try await client.lookup(ip: "1.1.1.1")
1212

13-
#expect(
14-
response == .ip(
15-
.init(
16-
ip: "1.1.1.1",
17-
asn: "AS13335",
18-
asName: "Cloudflare, Inc.",
19-
asDomain: "cloudflare.com",
20-
countryCode: "AU",
21-
country: "Australia",
22-
continentCode: "OC",
23-
continent: "Oceania"
24-
)
25-
)
26-
)
13+
let info = try #require({
14+
if case let .ip(info) = response { return info }
15+
Issue.record("Expected .ip, got \(response)")
16+
return nil
17+
}())
18+
19+
#expect(info.ip == "1.1.1.1")
20+
#expect(info.asn == "AS13335")
21+
#expect(info.asName == "Cloudflare, Inc.")
22+
#expect(info.asDomain == "cloudflare.com")
23+
#expect(info.countryCode != "")
24+
#expect(info.country != "")
25+
#expect(info.continentCode != "")
26+
#expect(info.continent != "")
2727
}
2828

2929
@Test func liteBogonTest() async throws {

0 commit comments

Comments
 (0)