From bc22ec382f843347333ef1301fc1bad773657f38 Mon Sep 17 00:00:00 2001 From: skim Date: Tue, 10 Mar 2020 15:21:37 -0700 Subject: [PATCH] adds additional test to meet exercise rules --- exercises/conversions/from_into.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/exercises/conversions/from_into.rs b/exercises/conversions/from_into.rs index 666f234b..58b860e9 100644 --- a/exercises/conversions/from_into.rs +++ b/exercises/conversions/from_into.rs @@ -70,4 +70,11 @@ mod tests { assert_eq!(p.name, "Mark"); assert_eq!(p.age, 20); } + #[test] + fn test_bad_age() { + // Test that "Mark.twenty" will return the default person due to an error in parsing age + let p = Person::from("Mark,twenty"); + assert_eq!(p.name, "John"); + assert_eq!(p.age, 30); + } }