MCPcopy Index your code
hub / github.com/TheAlgorithms/Python / test_rectangle

Function test_rectangle

geometry/tests/test_graham_scan.py:56–66  ·  view source on GitHub ↗

Test with a rectangle (4 points).

()

Source from the content-addressed store, hash-verified

54
55
56def 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
69def test_triangle_with_interior_points() -> None:

Callers

nothing calls this directly

Calls 2

PointClass · 0.90
graham_scanFunction · 0.90

Tested by

no test coverage detected