We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Err
1 parent 6a63856 commit f9b5230Copy full SHA for f9b5230
1 file changed
exercises/05_ticket_v2/13_try_from/src/lib.rs
@@ -23,6 +23,12 @@ mod tests {
23
24
let status = Status::try_from("Done".to_string()).unwrap();
25
assert_eq!(status, Status::Done);
26
+
27
+ let empty = String::new();
28
+ assert!(Status::try_from(empty).is_err());
29
30
+ let invalid = "InValid".to_string();
31
+ assert!(Status::try_from(invalid).is_err());
32
}
33
34
#[test]
@@ -35,5 +41,8 @@ mod tests {
35
41
36
42
let status = Status::try_from("done").unwrap();
37
43
44
45
+ assert!(Status::try_from("").is_err());
46
+ assert!(Status::try_from("invalid").is_err());
38
47
39
48
0 commit comments