Files
OpenFlare/pkg/geoip/country_centroid_test.go
T
ryan 8751c0dee3 fix(openflare): mmdb 国家名节点在世界地图使用正确质心
- 从 world-geo 生成国家质心表,Server 在仅有 ISO/国家名时补全 geo 坐标
- 全球态势板在缺少经纬度时按 geo_name 解析质心,避免 fallback 到美国
2026-06-20 19:46:33 +08:00

14 lines
286 B
Go

package geoip
import "testing"
func TestCountryCentroidGermany(t *testing.T) {
lat, lon, ok := CountryCentroidByISO("DE")
if !ok {
t.Fatal("expected DE centroid")
}
if lat < 47 || lat > 55 || lon < 5 || lon > 15 {
t.Fatalf("unexpected Germany centroid: %f,%f", lat, lon)
}
}