1
0
Fork 0
mirror of https://github.com/notohh/rustlings.git synced 2025-08-10 21:23:19 -04:00

test: Add missing test case for from_str exercise

This commit is contained in:
apatniv 2020-04-21 22:51:56 -04:00
commit 19fb1c240c

View file

@ -39,7 +39,11 @@ mod tests {
}
#[test]
fn good_input() {
assert!("John,32".parse::<Person>().is_ok());
let p = "John,32".parse::<Person>();
assert!(p.is_ok());
let p = p.unwrap();
assert_eq!(p.name, "John");
assert_eq!(p.age, 32);
}
#[test]
#[should_panic]