Skip to content
Myr

Add unit tests for max

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by sharkdp · committed by sharkdp · parent bd5d5fd · Browse files · 1 file+9 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+9 added−0 removed

  • other:+9 added−0 removed

1 file+9 added−0 removed

modified:src/hyperfine/internal.rs+9 added
94 unmodified lines
95 .min_by(|a, b| a.partial_cmp(b).unwrap())96 .unwrap()97 .clone()98}99100#[test]101fn test_max() {102 assert_eq!(1.0, max(&[1.0]));103 assert_eq!(-1.0, max(&[-1.0]));104 assert_eq!(-1.0, max(&[-2.0, -1.0]));105 assert_eq!(1.0, max(&[-1.0, 1.0]));106 assert_eq!(1.0, max(&[-1.0, 1.0, 0.0]));107}