Skip to content

Commit 9e17df0

Browse files
committed
Add a regression test to fix of issue #143
1 parent 6f7a23d commit 9e17df0

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/coord/logarithmic.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ impl<V: LogScalable> Ranged for LogCoord<V> {
8888
}
8989

9090
fn key_points(&self, max_points: usize) -> Vec<Self::ValueType> {
91-
let mut tier_1 = (self.logic.end.as_f64() / self.logic.start.as_f64())
91+
let tier_1 = (self.logic.end.as_f64() / self.logic.start.as_f64())
9292
.log10()
9393
.abs()
9494
.floor()
@@ -136,3 +136,13 @@ impl<V: LogScalable> Ranged for LogCoord<V> {
136136
self.logic.clone()
137137
}
138138
}
139+
#[cfg(test)]
140+
mod test {
141+
use super::*;
142+
#[test]
143+
fn regression_test_issue_143() {
144+
let range: LogCoord<f64> = LogRange(1.0..5.0).into();
145+
146+
range.key_points(100);
147+
}
148+
}

0 commit comments

Comments
 (0)