Skip to content

Commit

Permalink
Test that correct value is returned for height change
Browse files Browse the repository at this point in the history
  • Loading branch information
qwandor committed Jun 25, 2024
1 parent ab5e900 commit ccaa1d2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions third_party/rust-on-exercism/health-statistics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,13 @@ fn test_visit() {
assert_eq!(report.patient_name, "Bob");
assert_eq!(report.visit_count, 1);
assert_eq!(report.blood_pressure_change, None);
assert!((report.height_change - 0.9).abs() < 0.00001);

let report =
bob.visit_doctor(Measurements { height: 156.1, blood_pressure: (115, 76) });

assert_eq!(report.visit_count, 2);
assert_eq!(report.blood_pressure_change, Some((-5, -4)));
assert_eq!(report.height_change, 0.0);
}
// ANCHOR_END: tests

0 comments on commit ccaa1d2

Please sign in to comment.