Skip to content

Commit

Permalink
adds additional test to meet exercise rules
Browse files Browse the repository at this point in the history
  • Loading branch information
skim authored and sl4m committed Mar 11, 2020
1 parent 8b94790 commit bc22ec3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions exercises/conversions/from_into.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

0 comments on commit bc22ec3

Please sign in to comment.