summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorliv <mokou@fastmail.com>2022-08-03 17:34:43 +0200
committerGitHub <noreply@github.com>2022-08-03 17:34:43 +0200
commitaffc815447d0d7ee240c3b5fec5ce1c0a7175e54 (patch)
tree4335d22d8640da0f20a5de50c8e31630b684d27e
parentaf301a2efe7309b3a59df4f236322eb246140402 (diff)
parenta56f648ccefc18292c2fbc2e61043348c7cde79d (diff)
Merge pull request #1112 from tvkn/feat/options1/update-expected-result
feat(options1): update expected result
-rw-r--r--exercises/options/options1.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/exercises/options/options1.rs b/exercises/options/options1.rs
index 038fb48..c93ffba 100644
--- a/exercises/options/options1.rs
+++ b/exercises/options/options1.rs
@@ -14,6 +14,7 @@ fn print_number(maybe_number: Option<u16>) {
// TODO: Return an Option!
fn maybe_icecream(time_of_day: u16) -> Option<u16> {
// We use the 24-hour system here, so 10PM is a value of 22
+ // The Option output should gracefully handle cases where time_of_day > 24.
???
}
@@ -24,8 +25,9 @@ mod tests {
#[test]
fn check_icecream() {
assert_eq!(maybe_icecream(10), Some(5));
- assert_eq!(maybe_icecream(23), None);
- assert_eq!(maybe_icecream(22), None);
+ assert_eq!(maybe_icecream(23), Some(0));
+ assert_eq!(maybe_icecream(22), Some(0));
+ assert_eq!(maybe_icecream(25), None);
}
#[test]