Skip to content

Commit 4c31581

Browse files
committed
tests: add test_element_smaller_than_min
the `break` statement executed when the search reaches the leftmost column without finding the target element
1 parent b8fc4fe commit 4c31581

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/searching/saddleback_search.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,5 +108,14 @@ mod tests {
108108
200,
109109
(2, 3),
110110
),
111+
test_element_smaller_than_min: (
112+
vec![
113+
vec![1, 10, 100],
114+
vec![2, 20, 200],
115+
vec![3, 30, 300],
116+
],
117+
0,
118+
(0, 0),
119+
),
111120
}
112121
}

0 commit comments

Comments
 (0)