From 226ebc5274818618e0becc0484dc44568e6a740c Mon Sep 17 00:00:00 2001 From: Silvano Cerza Date: Wed, 19 Nov 2025 19:30:19 +0100 Subject: [PATCH] Fix tests failing because of location change --- Tests/ipinfoKitTests/IPInfoLiteTests.swift | 28 +++++++++++----------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/Tests/ipinfoKitTests/IPInfoLiteTests.swift b/Tests/ipinfoKitTests/IPInfoLiteTests.swift index 696f6da..5da78c6 100644 --- a/Tests/ipinfoKitTests/IPInfoLiteTests.swift +++ b/Tests/ipinfoKitTests/IPInfoLiteTests.swift @@ -10,20 +10,20 @@ struct IPInfoLiteTests { let response = try await client.lookup(ip: "1.1.1.1") - #expect( - response == .ip( - .init( - ip: "1.1.1.1", - asn: "AS13335", - asName: "Cloudflare, Inc.", - asDomain: "cloudflare.com", - countryCode: "AU", - country: "Australia", - continentCode: "OC", - continent: "Oceania" - ) - ) - ) + let info = try #require({ + if case let .ip(info) = response { return info } + Issue.record("Expected .ip, got \(response)") + return nil + }()) + + #expect(info.ip == "1.1.1.1") + #expect(info.asn == "AS13335") + #expect(info.asName == "Cloudflare, Inc.") + #expect(info.asDomain == "cloudflare.com") + #expect(info.countryCode != "") + #expect(info.country != "") + #expect(info.continentCode != "") + #expect(info.continent != "") } @Test func liteBogonTest() async throws {