summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2017-12-08 20:47:09 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2017-12-08 20:47:09 (GMT)
commitcf11fcf862b98ef57935bcfccd6f2f6ae3f925f6 (patch)
treed7ae9d965b8eea03adfaf7a4d42907aae683d0f9 /tests
parent48ac5e6e8fe50c1ff4b9e77440a6365f8b01021f (diff)
Improved the way vmpa_t types are compared.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/arch/vmpa.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/arch/vmpa.py b/tests/arch/vmpa.py
index def61ea..09c3d9d 100755
--- a/tests/arch/vmpa.py
+++ b/tests/arch/vmpa.py
@@ -33,3 +33,29 @@ class TestVmpa(ChrysalideTestCase):
self.assertEqual(a, b)
self.assertEqual(a, c)
+
+
+ def testCompareWrong(self):
+ """Verify unhandled comparisons with VMPA."""
+
+ a = vmpa()
+
+ with self.assertRaisesRegex(Exception, 'Unable to cast object as VMPA.'):
+
+ self.assertLess(a, 'b')
+
+
+ def testCompareFair(self):
+ """Verify right VMPA comparisons."""
+
+ a = vmpa(0)
+ b = vmpa()
+
+ self.assertLess(a, b)
+
+ self.assertGreater(b, a)
+
+ a = vmpa()
+ b = vmpa()
+
+ self.assertEqual(a, b)