From 1f796d6b4529abc7a28edfae2944cb28ee2e75b8 Mon Sep 17 00:00:00 2001 From: Tristan Matthews Date: Wed, 15 Sep 2021 16:22:15 -0400 Subject: [PATCH] test: add first_max_element check for 1-elem lists 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. --- src/cdef.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/cdef.rs b/src/cdef.rs index 08a222677b..fdffd21735 100644 --- a/src/cdef.rs +++ b/src/cdef.rs @@ -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)); } } }