chore: merge backend repo history into monorepo at backend/
git-subtree-dir: backend git-subtree-mainline:dc11190527git-subtree-split:acae976622
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user