Files
mobiniqow 35f5084005 chore: merge backend repo history into monorepo at backend/
git-subtree-dir: backend
git-subtree-mainline: dc11190527
git-subtree-split: acae976622
2026-09-27 10:30:16 +03:30

19 lines
529 B
Go

package utils
import "testing"
func TestHaversineKM_SamePoint(t *testing.T) {
d := HaversineKM(35.6892, 51.3890, 35.6892, 51.3890)
if d > 0.001 {
t.Fatalf("expected ~0km for identical points, got %v", d)
}
}
func TestHaversineKM_TehranToIsfahan(t *testing.T) {
// فاصله‌ی تهران تا اصفهان تقریباً ۳۴۰ کیلومتره (خط مستقیم)
d := HaversineKM(35.6892, 51.3890, 32.6546, 51.6680)
if d < 300 || d > 380 {
t.Fatalf("expected ~340km between Tehran and Isfahan, got %v", d)
}
}