Skip to content

Commit

Permalink
test tolerances
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelkirk committed Sep 25, 2024
1 parent 5ae5890 commit 8446610
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion geo/src/algorithm/line_measures/metric_spaces/geodesic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ mod tests {
let route =
MetricSpace::points_along_line(start, end, max_dist, false).collect::<Vec<_>>();
assert_eq!(route.len(), 11);
assert_eq!(route[0], Point::new(17.878754355562464, 24.466667836189565));
assert_relative_eq!(route[0], Point::new(17.878754355562464, 24.466667836189565));
}
}
}
Expand Down
18 changes: 15 additions & 3 deletions geo/src/algorithm/line_measures/metric_spaces/rhumb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,11 @@ mod tests {
let start = Point::new(10.0, 20.0);
let end = Point::new(125.0, 25.0);
let midpoint = MetricSpace::point_at_ratio_between(start, end, 0.5);
assert_relative_eq!(midpoint, Point::new(66.98011173721943, 22.500000000000007));
assert_relative_eq!(
midpoint,
Point::new(66.98011173721943, 22.500000000000007),
epsilon = 1.0e-10
);
}
#[test]
fn points_along_line_with_endpoints() {
Expand All @@ -293,7 +297,11 @@ mod tests {
assert_eq!(route.len(), 13);
assert_eq!(route[0], start);
assert_eq!(route.last().unwrap(), &end);
assert_relative_eq!(route[1], Point::new(19.43061818495096, 20.416666666666668));
assert_relative_eq!(
route[1],
Point::new(19.43061818495096, 20.416666666666668),
epsilon = 1.0e-10
);
}
#[test]
fn points_along_line_without_endpoints() {
Expand All @@ -303,7 +311,11 @@ mod tests {
let route =
MetricSpace::points_along_line(start, end, max_dist, false).collect::<Vec<_>>();
assert_eq!(route.len(), 11);
assert_relative_eq!(route[0], Point::new(19.43061818495096, 20.416666666666668));
assert_relative_eq!(
route[0],
Point::new(19.43061818495096, 20.416666666666668),
epsilon = 1.0e-10
);
}
}
}

0 comments on commit 8446610

Please sign in to comment.