Add negative test for rectangles project

This commit is contained in:
Manuel Thalmann 2025-03-02 23:11:55 +01:00
parent 6dab472b9d
commit 3787fe47fd

View file

@ -38,4 +38,18 @@ mod tests {
assert!(larger.can_hold(&smaller)); assert!(larger.can_hold(&smaller));
} }
#[test]
fn smaller_cannot_hold_larger() {
let larger = Rectangle {
width: 8,
height: 7,
};
let smaller = Rectangle {
width: 5,
height: 1,
};
assert!(!smaller.can_hold(&larger));
}
} }