Skip to content

Commit c923cc6

Browse files
committed
C#: Add tests for dynamic comparisons
1 parent cb7db8f commit c923cc6

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

csharp/ql/test/library-tests/commons/ComparisonTest/ComparisonTest.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,4 +106,16 @@ void M(int x, int y)
106106
b = x.CompareTo(y).CompareTo(0).CompareTo(1) == 0;
107107
}
108108
}
109+
110+
void DynamicComparisons(object o1, object o2)
111+
{
112+
dynamic d1 = o1;
113+
dynamic d2 = o2;
114+
var b = d1 == d2;
115+
b = d1 != d2;
116+
b = d1 > d2;
117+
b = d1 < d2;
118+
b = d1 >= d2;
119+
b = d1 <= d2;
120+
}
109121
}

0 commit comments

Comments
 (0)