Skip to content

Commit 19fb1c2

Browse files
committed
test: Add missing test case for from_str exercise
1 parent 630ff0e commit 19fb1c2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

exercises/conversions/from_str.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,11 @@ mod tests {
3939
}
4040
#[test]
4141
fn good_input() {
42-
assert!("John,32".parse::<Person>().is_ok());
42+
let p = "John,32".parse::<Person>();
43+
assert!(p.is_ok());
44+
let p = p.unwrap();
45+
assert_eq!(p.name, "John");
46+
assert_eq!(p.age, 32);
4347
}
4448
#[test]
4549
#[should_panic]

0 commit comments

Comments
 (0)