From 32230f19f0be70b62c41c44614dbe5eddde5027d Mon Sep 17 00:00:00 2001 From: Andrew Walbran Date: Mon, 29 Jul 2024 15:16:51 +0100 Subject: [PATCH] Test that correct value is returned for height change (#2164) --- third_party/rust-on-exercism/health-statistics.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/third_party/rust-on-exercism/health-statistics.rs b/third_party/rust-on-exercism/health-statistics.rs index 52ab7ebb..b414e61a 100644 --- a/third_party/rust-on-exercism/health-statistics.rs +++ b/third_party/rust-on-exercism/health-statistics.rs @@ -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