From 54731f0fc0b0fde18438853c0a8abaa968edb57a Mon Sep 17 00:00:00 2001 From: Hunter Kvalevog Date: Sun, 27 Sep 2026 16:34:25 -0500 Subject: rustlings: complete 17 --- rustlings/exercises/17_tests/tests3.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'rustlings/exercises/17_tests/tests3.rs') diff --git a/rustlings/exercises/17_tests/tests3.rs b/rustlings/exercises/17_tests/tests3.rs index 822184e..085bb62 100644 --- a/rustlings/exercises/17_tests/tests3.rs +++ b/rustlings/exercises/17_tests/tests3.rs @@ -29,13 +29,14 @@ mod tests { // TODO: This test should check if the rectangle has the size that we // pass to its constructor. let rect = Rectangle::new(10, 20); - assert_eq!(todo!(), 10); // Check width - assert_eq!(todo!(), 20); // Check height + assert_eq!(rect.width, 10); // Check width + assert_eq!(rect.height, 20); // Check height } // TODO: This test should check if the program panics when we try to create // a rectangle with negative width. #[test] + #[should_panic] fn negative_width() { let _rect = Rectangle::new(-10, 10); } @@ -43,6 +44,7 @@ mod tests { // TODO: This test should check if the program panics when we try to create // a rectangle with negative height. #[test] + #[should_panic] fn negative_height() { let _rect = Rectangle::new(10, -10); } -- cgit v1.2.3