Skip to content

Commit

Permalink
add test for rectangle intersects with zero area rectangle
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmoten committed Jun 26, 2019
1 parent 3cb0490 commit f7e210c
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,14 @@ public void testIntersectsOneRectangleContainsTheOther() {
assertTrue(b.intersects(a));
}

@Test
public void testIntersectsOneRectangleReturnsTrueDespiteZeroArea() {
Rectangle a = rectangle(10, 50, 50, 50);
Rectangle b = rectangle(20, 20, 60, 60);
assertTrue(a.intersects(b));
assertTrue(b.intersects(a));
}

@Test
public void testContains() {
Rectangle r = rectangle(10, 20, 30, 40);
Expand Down

0 comments on commit f7e210c

Please sign in to comment.