Skip to content

Commit

Permalink
fix(vec1): Have test compare every element in a and v
Browse files Browse the repository at this point in the history
The previous test would stop comparing elements in array a and vec v upon reaching the last element of either. This resulted in the test passing even if v did not contain all the elements in a. This change to the test fixes that bug and should only pass if all the elements in a and v are present and equal.
  • Loading branch information
tinkhauser committed Nov 29, 2020
1 parent 5aa467b commit 9b6c629
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion exercises/collections/vec1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ mod tests {
#[test]
fn test_array_and_vec_similarity() {
let (a, v) = array_and_vec();
assert!(a.iter().zip(v.iter()).all(|(x, y)| x == y));
assert_eq!(a, v[..]);
}
}

0 comments on commit 9b6c629

Please sign in to comment.