File tree Expand file tree Collapse file tree 1 file changed +14
-14
lines changed
Expand file tree Collapse file tree 1 file changed +14
-14
lines changed Original file line number Diff line number Diff 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 {
You can’t perform that action at this time.
0 commit comments