summaryrefslogtreecommitdiff
path: root/exercises/options/options1.rs
diff options
context:
space:
mode:
authorNico Vromans <48183857+nico-vromans@users.noreply.github.com>2022-08-15 10:05:50 +0200
committerGitHub <noreply@github.com>2022-08-15 10:05:50 +0200
commite8122daa8709274226c40fe8008fdfc86ad4493a (patch)
tree9db4b881d321f3ece0d6c409dccd11acbb89c8c4 /exercises/options/options1.rs
parent8dfffe8aa2494857b44b4ce07c037a8c757d934c (diff)
Update options1.rs
Added extra test for before 10PM and updated the test for at 10PM (when it's 10PM there should already not be any ice cream left, as per the description). Also fixed the `raw_value` test, as it is later than 10PM, so there should be no more ice cream left.
Diffstat (limited to 'exercises/options/options1.rs')
-rw-r--r--exercises/options/options1.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/exercises/options/options1.rs b/exercises/options/options1.rs
index 99c9591..022d3d6 100644
--- a/exercises/options/options1.rs
+++ b/exercises/options/options1.rs
@@ -19,7 +19,8 @@ mod tests {
#[test]
fn check_icecream() {
- assert_eq!(maybe_icecream(10), Some(5));
+ assert_eq!(maybe_icecream(9), Some(5));
+ assert_eq!(maybe_icecream(10), Some(0));
assert_eq!(maybe_icecream(23), Some(0));
assert_eq!(maybe_icecream(22), Some(0));
assert_eq!(maybe_icecream(25), None);
@@ -29,6 +30,6 @@ mod tests {
fn raw_value() {
// TODO: Fix this test. How do you get at the value contained in the Option?
let icecreams = maybe_icecream(12);
- assert_eq!(icecreams, 5);
+ assert_eq!(icecreams, 0);
}
}