mirror of
https://github.com/sharkdp/hyperfine.git
synced 2026-10-28 16:18:57 +00:00
Add unit tests for max
This commit is contained in:
1 parent
bd5d5fd4fa
commit
93386dc808
1 file changed
+9
@@ -96,3 +96,12 @@ pub fn min(vals: &[f64]) -> f64 {
|
||||
.unwrap()
|
||||
.clone()
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_max() {
|
||||
assert_eq!(1.0, max(&[1.0]));
|
||||
assert_eq!(-1.0, max(&[-1.0]));
|
||||
assert_eq!(-1.0, max(&[-2.0, -1.0]));
|
||||
assert_eq!(1.0, max(&[-1.0, 1.0]));
|
||||
assert_eq!(1.0, max(&[-1.0, 1.0, 0.0]));
|
||||
}
|
||||
Reference in new issue
Block a user