Skip to content

Commit 67032ea

Browse files
committed
Vendor System.Drawing.Point for testing on .NET Core
1 parent 0d7e43a commit 67032ea

File tree

4 files changed

+14
-6
lines changed

4 files changed

+14
-6
lines changed

src/testing/arraytest.cs

+12
Original file line numberDiff line numberDiff line change
@@ -314,4 +314,16 @@ public static Spam[][] EchoRangeAA(Spam[][] items)
314314
return items;
315315
}
316316
}
317+
318+
public struct Point
319+
{
320+
public Point(float x, float y)
321+
{
322+
X = x;
323+
Y = y;
324+
}
325+
326+
public float X { get; set; }
327+
public float Y { get; set; }
328+
}
317329
}

tests/fixtures/.gitkeep

Whitespace-only changes.

tests/test_array.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -1166,10 +1166,8 @@ def test_boxed_value_type_mutation_result():
11661166
# to accidentally write code like the following which is not really
11671167
# mutating value types in-place but changing boxed copies.
11681168

1169-
clr.AddReference('System.Drawing')
1170-
1171-
from System.Drawing import Point
11721169
from System import Array
1170+
from Python.Test import Point
11731171

11741172
items = Array.CreateInstance(Point, 5)
11751173

tests/test_class.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,7 @@ def __init__(self, v):
126126
def test_struct_construction():
127127
"""Test construction of structs."""
128128

129-
clr.AddReference('System.Drawing')
130-
131-
from System.Drawing import Point
129+
from Python.Test import Point
132130

133131
p = Point()
134132
assert p.X == 0

0 commit comments

Comments
 (0)