C#: Add tests for dynamic comparisons

This commit is contained in:
Tom Hvitved
2019-09-20 09:03:45 +02:00
parent cb7db8f4c0
commit c923cc6378

View File

@@ -106,4 +106,16 @@ class ComparisonTest
b = x.CompareTo(y).CompareTo(0).CompareTo(1) == 0;
}
}
void DynamicComparisons(object o1, object o2)
{
dynamic d1 = o1;
dynamic d2 = o2;
var b = d1 == d2;
b = d1 != d2;
b = d1 > d2;
b = d1 < d2;
b = d1 >= d2;
b = d1 <= d2;
}
}