Skip to content

Commit

Permalink
tests: verify test data
Browse files Browse the repository at this point in the history
  • Loading branch information
vil02 authored Oct 25, 2024
1 parent 4850aeb commit 8926dee
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/searching/linear_search.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ mod tests {
#[test]
fn $name() {
let (item, arr, expected) = $tc;
if let Some(expected_index) = expected {
assert_eq!(arr[expected_index], item);
}
assert_eq!(linear_search(&item, arr), expected);
}
)*
Expand Down

0 comments on commit 8926dee

Please sign in to comment.