fixes
Build and Publish / Metadata (push) Successful in 2s
Build and Publish / BuildAndDeployAmd64 (push) Failing after 4s

This commit is contained in:
mats committed 2026-09-20 09:52:49 +02:00
1 parent f30adf05af
commit 8824af8699
29 files changed
+1201 -115

No files matched your search

+25
View File
@@ -0,0 +1,25 @@
package geoip
import (
"net/netip"
"testing"
)
func TestLookupWithoutDB(t *testing.T) {
var l *Lookup
if r := l.Lookup(netip.MustParseAddr("8.8.8.8")); r.Configured || r.Country != "" {
t.Fatalf("unexpected result %+v", r)
}
if r := l.Lookup(netip.MustParseAddr("10.1.2.3")); r.Scope != "private" {
t.Fatalf("want private scope, got %+v", r)
}
if r := l.Lookup(netip.MustParseAddr("::ffff:127.0.0.1")); r.Scope != "loopback" || r.IP != "127.0.0.1" {
t.Fatalf("want unmapped loopback, got %+v", r)
}
}
func TestOpenEmpty(t *testing.T) {
if l, err := Open("", ""); l != nil || err != nil {
t.Fatalf("want nil,nil got %v,%v", l, err)
}
}