internal/geodb/geodb_test.go

package geodb

import (
	"testing"
)

func TestNewGeoDB(t *testing.T) {
	// Test with empty paths
	g, err := NewGeoDB("", "")
	if err == nil {
		t.Error("NewGeoDB with empty paths should return error")
	}
	if g != nil {
		t.Error("NewGeoDB with empty paths should return nil GeoDB")
	}

	// Test with non-existent paths
	g, err = NewGeoDB("nonexistent_asn.mmdb", "nonexistent_city.mmdb")
	if err == nil {
		t.Error("NewGeoDB with non-existent paths should return error")
	}
	if g != nil {
		t.Error("NewGeoDB with non-existent paths should return nil GeoDB")
	}
}