- big refactor for scheduler.
This commit is contained in:
@@ -11,3 +11,20 @@ func TestEarthDistance(t *testing.T) {
|
||||
distance := EarthDistance(lat1, lng1, lat2, lng2)
|
||||
fmt.Print(distance)
|
||||
}
|
||||
|
||||
func TestMapValue2Scope(t *testing.T) {
|
||||
result := MapValue2Scope(-4, -10, 0, 0, 100)
|
||||
if result != 60 {
|
||||
t.Fatalf("result:%d is wrong", result)
|
||||
}
|
||||
|
||||
result = MapValue2Scope(-4, 0, 10, 0, 100)
|
||||
if result != 0 {
|
||||
t.Fatalf("result:%d is wrong", result)
|
||||
}
|
||||
|
||||
result = MapValue2Scope(100, 0, 10, 0, 100)
|
||||
if result != 100 {
|
||||
t.Fatalf("result:%d is wrong", result)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user