diff options
| author | Bert Apperlo <91734527+b-apperlo@users.noreply.github.com> | 2023-06-08 15:49:07 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-06-08 15:49:07 +0200 |
| commit | bbfb4c7e63dc59a4e8afbb8d2a10b35414782256 (patch) | |
| tree | 6185503dbfd83336481b672d63254c571e2e160a /exercises/hashmaps/hashmaps2.rs | |
| parent | 30291a3c253f08a4191cfd544ba36867612ebb7a (diff) | |
feat: added test function to hashmaps2.rs
The existing test functions only check if a kind of fruit exists in the hashmap, but not if the amount of fruits is higher than zero. This new test function solves this.
Diffstat (limited to 'exercises/hashmaps/hashmaps2.rs')
| -rw-r--r-- | exercises/hashmaps/hashmaps2.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/exercises/hashmaps/hashmaps2.rs b/exercises/hashmaps/hashmaps2.rs index a4f069a..852c076 100644 --- a/exercises/hashmaps/hashmaps2.rs +++ b/exercises/hashmaps/hashmaps2.rs @@ -80,4 +80,13 @@ mod tests { let count = basket.values().sum::<u32>(); assert!(count > 11); } + + #[test] + fn all_fruit_types_in_basket() { + let mut basket = get_fruit_basket(); + fruit_basket(&mut basket); + for amount in basket.values() { + assert_ne!(amount, &0); + } + } } |
