We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ddb3163 commit 4daa7bdCopy full SHA for 4daa7bd
lib/matplotlib/tests/test_path.py
@@ -60,6 +60,22 @@ def test_point_in_path():
60
np.testing.assert_equal(ret, [True, False])
61
62
63
+@pytest.mark.parametrize(
64
+ "other_path, inside, reverted_inside",
65
+ [(Path([(0.25, 0.25), (0.25, 0.75), (0.75, 0.75), (0.75, 0.25), (0.25, 0.25)],
66
+ closed=True), True, False),
67
+ (Path([(-0.25, -0.25), (-0.25, 1.75), (1.75, 1.75), (1.75, -0.25), (-0.25, -0.25)],
68
+ closed=True), False, True),
69
+ (Path([(0.25, 0.25), (0.25, 1.25), (1.25, 1.25), (1.25, 0.25), (0.25, 0.25)],
70
+ closed=True), False, False),
71
+ (Path([(0, 0), (0, 1), (1, 1), (1, 0), (0, 0)], closed=True), False, False)]
72
+ )
73
+def test_path_in_path(other_path, inside, reverted_inside):
74
+ path = Path([(0, 0), (0, 1), (1, 1), (1, 0), (0, 0)], closed=True)
75
+ assert path.contains_path(other_path) is inside
76
+ assert other_path.contains_path(path) is reverted_inside
77
+
78
79
def test_contains_points_negative_radius():
80
path = Path.unit_circle()
81
0 commit comments