Rev | Line | |
---|
[1230] | 1 | from unittest.case import TestCase
|
---|
| 2 | from tudelft.utilities.tools.comparator import DefaultComparator
|
---|
| 3 |
|
---|
| 4 | class comparatorTest(TestCase):
|
---|
| 5 | def testSimple(self):
|
---|
| 6 | c=DefaultComparator()
|
---|
| 7 |
|
---|
| 8 | self.assertEqual(0, c.compare(1, 1))
|
---|
| 9 | self.assertEqual(1, c.compare(2, 1))
|
---|
| 10 | self.assertEqual(1, c.compare(11, -1))
|
---|
| 11 | self.assertEqual(0, c.compare('a', 'a'))
|
---|
| 12 | self.assertEqual(0, c.compare("a", "a"))
|
---|
| 13 |
|
---|
| 14 | self.assertEqual(-1, c.compare("a", "b"))
|
---|
| 15 | self.assertEqual(-1, c.compare("a", "aha"))
|
---|
| 16 | self.assertEqual(-1, c.compare(11, 12))
|
---|
| 17 | |
---|
Note:
See
TracBrowser
for help on using the repository browser.