1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 20:42:21 +02:00

More generic conformance tests

This commit is contained in:
Brian Fiete 2020-06-30 16:02:15 -07:00
parent eec61a425b
commit b60fed96c0

View file

@ -87,6 +87,21 @@ namespace Tests
{ {
} }
public static int MethodA<T>(T val) where T : var
{
return 1;
}
public static int MethodA<T>(T val) where T : ValueType
{
return 2;
}
public static int MethodA<T>(T val) where T : Enum
{
return 3;
}
[Test] [Test]
public static void TestBasics() public static void TestBasics()
{ {
@ -100,6 +115,10 @@ namespace Tests
LibA.LibA0.Alloc<ClassA>(); LibA.LibA0.Alloc<ClassA>();
LibA.LibA0.Alloc<ClassB>(); LibA.LibA0.Alloc<ClassB>();
Test.Assert(MethodA("") == 1);
Test.Assert(MethodA(1.2f) == 2);
Test.Assert(MethodA(TypeCode.Boolean) == 3);
} }
} }