From 19fb1c240c25b7dc50fc64c48a60bdb5f28f6de6 Mon Sep 17 00:00:00 2001 From: apatniv Date: Tue, 21 Apr 2020 22:51:56 -0400 Subject: [PATCH] test: Add missing test case for from_str exercise --- exercises/conversions/from_str.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/exercises/conversions/from_str.rs b/exercises/conversions/from_str.rs index 3c889d73..7b4fdaca 100644 --- a/exercises/conversions/from_str.rs +++ b/exercises/conversions/from_str.rs @@ -39,7 +39,11 @@ mod tests { } #[test] fn good_input() { - assert!("John,32".parse::().is_ok()); + let p = "John,32".parse::(); + assert!(p.is_ok()); + let p = p.unwrap(); + assert_eq!(p.name, "John"); + assert_eq!(p.age, 32); } #[test] #[should_panic]