Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Vendor System.Drawing.Point for testing on .NET Core
  • Loading branch information
filmor committed Feb 14, 2021
commit 67032ea055ed6a6e9ea02a5cf2cb8598961e20d7
12 changes: 12 additions & 0 deletions src/testing/arraytest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -314,4 +314,16 @@ public static Spam[][] EchoRangeAA(Spam[][] items)
return items;
}
}

public struct Point
{
public Point(float x, float y)
{
X = x;
Y = y;
}

public float X { get; set; }
public float Y { get; set; }
}
}
Empty file removed tests/fixtures/.gitkeep
Empty file.
4 changes: 1 addition & 3 deletions tests/test_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -1166,10 +1166,8 @@ def test_boxed_value_type_mutation_result():
# to accidentally write code like the following which is not really
# mutating value types in-place but changing boxed copies.

clr.AddReference('System.Drawing')

from System.Drawing import Point
from System import Array
from Python.Test import Point

items = Array.CreateInstance(Point, 5)

Expand Down
4 changes: 1 addition & 3 deletions tests/test_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,7 @@ def __init__(self, v):
def test_struct_construction():
"""Test construction of structs."""

clr.AddReference('System.Drawing')

from System.Drawing import Point
from Python.Test import Point

p = Point()
assert p.X == 0
Expand Down