Skip to content

Commit e8122da

Browse files
authored
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.
1 parent 8dfffe8 commit e8122da

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

exercises/options/options1.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ mod tests {
1919

2020
#[test]
2121
fn check_icecream() {
22-
assert_eq!(maybe_icecream(10), Some(5));
22+
assert_eq!(maybe_icecream(9), Some(5));
23+
assert_eq!(maybe_icecream(10), Some(0));
2324
assert_eq!(maybe_icecream(23), Some(0));
2425
assert_eq!(maybe_icecream(22), Some(0));
2526
assert_eq!(maybe_icecream(25), None);
@@ -29,6 +30,6 @@ mod tests {
2930
fn raw_value() {
3031
// TODO: Fix this test. How do you get at the value contained in the Option?
3132
let icecreams = maybe_icecream(12);
32-
assert_eq!(icecreams, 5);
33+
assert_eq!(icecreams, 0);
3334
}
3435
}

0 commit comments

Comments
 (0)