Test with a rectangle (4 points).
()
| 54 | |
| 55 | |
| 56 | def test_rectangle() -> None: |
| 57 | """Test with a rectangle (4 points).""" |
| 58 | p1 = Point(1, 1) |
| 59 | p2 = Point(2, 1) |
| 60 | p3 = Point(2, 2) |
| 61 | p4 = Point(1, 2) |
| 62 | points = [p1, p2, p3, p4] |
| 63 | hull = graham_scan(points) |
| 64 | |
| 65 | assert len(hull) == 4 |
| 66 | assert all(p in hull for p in points) |
| 67 | |
| 68 | |
| 69 | def test_triangle_with_interior_points() -> None: |
nothing calls this directly
no test coverage detected