We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1c789dd commit a750e4aCopy full SHA for a750e4a
2 files changed
exercises/error_handling/option1.rs
@@ -4,7 +4,7 @@
4
// on `None`. Handle this in a more graceful way than calling `unwrap`!
5
// Scroll down for hints :)
6
7
-fn main() {
+pub fn pop_too_much() -> bool {
8
let mut list = vec![3];
9
10
let last = list.pop().unwrap();
@@ -15,9 +15,18 @@ fn main() {
15
"The second-to-last item in the list is {:?}",
16
second_to_last
17
);
18
+ true
19
}
20
21
+#[cfg(test)]
22
+mod tests {
23
+ use super::*;
24
25
+ #[test]
26
+ fn should_not_panic() {
27
+ assert!(pop_too_much(), true);
28
+ }
29
+}
30
31
32
info.toml
@@ -192,7 +192,7 @@ mode = "test"
192
193
[[exercises]]
194
path = "exercises/error_handling/option1.rs"
195
-mode = "compile"
+mode = "test"
196
197
198
path = "exercises/error_handling/result1.rs"
0 commit comments