diff options
| author | Jacob Tinkhauser <75188781+tinkhauser@users.noreply.github.com> | 2020-11-29 01:35:14 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-11-29 01:35:14 +0000 |
| commit | 9b6c629397b24b944f484f5b2bbd8144266b5695 (patch) | |
| tree | 3f5a9734c81a7a1ade18e2b3ae94d6fab97e8e7c | |
| parent | 5aa467bef291a751f99d620484685933950c6971 (diff) | |
fix(vec1): Have test compare every element in a and v
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.
| -rw-r--r-- | exercises/collections/vec1.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/exercises/collections/vec1.rs b/exercises/collections/vec1.rs index ac3d9f1..f6bc837 100644 --- a/exercises/collections/vec1.rs +++ b/exercises/collections/vec1.rs @@ -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[..]); } } |
