Add negative test for rectangles project
This commit is contained in:
parent
6dab472b9d
commit
3787fe47fd
1 changed files with 14 additions and 0 deletions
|
@ -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));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue