Skip to content

Commit

Permalink
style: unify test naming by removing preceding test_
Browse files Browse the repository at this point in the history
  • Loading branch information
moldhouse committed Mar 18, 2024
1 parent 4dac0db commit ef5d1c0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions src/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ mod tests {
use super::*;

#[test]
fn test_item_with_super_set_does_not_place_upperbound() {
fn item_with_super_set_does_not_place_upperbound() {
let flat_points = vec![FlatPoint { x: 0.0, y: 0.0 }, FlatPoint { x: 1.0, y: 1.0 }];
let mut candidate = CacheItem {
start: 0,
Expand All @@ -123,7 +123,7 @@ mod tests {
}

#[test]
fn test_item_with_sub_set_places_upperbound() {
fn item_with_sub_set_places_upperbound() {
let flat_points = vec![FlatPoint { x: 0.0, y: 0.0 }, FlatPoint { x: 1.0, y: 1.0 }];
let mut candidate = CacheItem {
start: 0,
Expand All @@ -145,7 +145,7 @@ mod tests {
}

#[test]
fn test_item_with_sub_set_but_bigger_distance() {
fn item_with_sub_set_but_bigger_distance() {
let flat_points = vec![FlatPoint { x: 0.0, y: 0.0 }, FlatPoint { x: 1.0, y: 1.0 }];
let mut candidate = CacheItem {
start: 0,
Expand All @@ -167,7 +167,7 @@ mod tests {
}

#[test]
fn test_set_preserves_order() {
fn set_preserves_order() {
let mut cache = Cache::new();
let first_item = CacheItem {
start: 0,
Expand All @@ -187,7 +187,7 @@ mod tests {
}

#[test]
fn test_empty_cache_returns_false() {
fn empty_cache_returns_false() {
let flat_points = vec![FlatPoint { x: 0.0, y: 0.0 }, FlatPoint { x: 1.0, y: 1.0 }];
let mut candidate = CacheItem {
start: 0,
Expand All @@ -201,7 +201,7 @@ mod tests {
}

#[test]
fn test_cache_with_sub_set_item_returns_true() {
fn cache_with_sub_set_item_returns_true() {
let flat_points = vec![FlatPoint { x: 0.0, y: 0.0 }, FlatPoint { x: 1.0, y: 1.0 }];
let mut candidate = CacheItem {
start: 0,
Expand Down
10 changes: 5 additions & 5 deletions src/flat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ mod tests {
}

#[test]
fn test_circ_mean() {
fn circ_mean_works_on_zero_degree_crossing() {
assert_approx_eq!(circ_mean(0., 0.), 0., 1e-5);
assert_approx_eq!(circ_mean(0., 90.0), 45., 1e-5);
assert_approx_eq!(circ_mean(0., 180.), -90., 1e-5);
Expand All @@ -117,7 +117,7 @@ mod tests {
assert_approx_eq!(circ_mean(90., -180.), 135., 1e-5);
}
#[test]
fn test_bbox_from_point() {
fn bbox_is_equal_to_point() {
let point = (10., 50.0);
let bbox = BBox::from(&point);
assert_eq!(bbox.lon_min, 10.);
Expand All @@ -126,7 +126,7 @@ mod tests {
assert_eq!(bbox.lat_max, 50.);
}
#[test]
fn test_bbox_from_points() {
fn bbox_contains_all_points() {
let points: Vec<(f64, f64)> = vec![];
assert!(points.center().is_none());

Expand All @@ -139,7 +139,7 @@ mod tests {
assert_approx_eq!(bbox.lat_max, 52.);
}
#[test]
fn test_bbox_center() {
fn bbox_center() {
let bbox = BBox {
lon_min: -10.,
lon_max: 12.,
Expand All @@ -153,7 +153,7 @@ mod tests {
}

#[test]
fn test_bbox_longitude_overflow() {
fn bbox_longitude_does_not_overflow() {
let points = vec![(179., 50.), (-179., 50.)];
let center = points.center().unwrap();
assert_approx_eq!(center.0, 180.);
Expand Down

0 comments on commit ef5d1c0

Please sign in to comment.