Skip to content

Commit

Permalink
test: add first_max_element check for 1-elem lists
Browse files Browse the repository at this point in the history
This is not needed currently as cost is always 8 elements long but will guard against
unexpected breakage should the function be used on single element lists in the future.
  • Loading branch information
tmatth committed Sep 15, 2021
1 parent 2ec4e67 commit 1f796d6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/cdef.rs
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ pub(crate) mod rust {
assert_eq!(first_max_element(&[-1, -1, 1, 2, 3, 4, 6, 6]), (6, 6));
assert_eq!(first_max_element(&[-1, -1, 1, 2, 3, 4, 7, 6]), (6, 7));
assert_eq!(first_max_element(&[0, 0]), (0, 0));
assert_eq!(first_max_element(&[0]), (0, 0));
}
}
}
Expand Down

0 comments on commit 1f796d6

Please sign in to comment.