Skip to content

Commit 8926dee

Browse files
authored
tests: verify test data
1 parent 4850aeb commit 8926dee

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/searching/linear_search.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ mod tests {
2929
#[test]
3030
fn $name() {
3131
let (item, arr, expected) = $tc;
32+
if let Some(expected_index) = expected {
33+
assert_eq!(arr[expected_index], item);
34+
}
3235
assert_eq!(linear_search(&item, arr), expected);
3336
}
3437
)*

0 commit comments

Comments
 (0)