Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9f2796a commit b0aca5cCopy full SHA for b0aca5c
src/embed_tests/TestOperator.cs
@@ -335,6 +335,29 @@ public void SymmetricalOperatorOverloads()
335
");
336
}
337
338
+ [Test]
339
+ public void OperatorInequality()
340
+ {
341
+ string name = string.Format("{0}.{1}",
342
+ typeof(OperableObject).DeclaringType.Name,
343
+ typeof(OperableObject).Name);
344
+ string module = MethodBase.GetCurrentMethod().DeclaringType.Namespace;
345
+
346
+ PythonEngine.Exec($@"
347
+from {module} import *
348
+cls = {name}
349
+b = cls(10)
350
+a = cls(2)
351
352
353
+c = a <= b
354
+assert c == (a.Num <= b.Num)
355
356
+c = a >= b
357
+assert c == (a.Num >= b.Num)
358
+");
359
+ }
360
361
[Test]
362
public void OperatorOverloadMissingArgument()
363
{
0 commit comments