Skip to content

Commit

Permalink
Enhance tests for LooseVersion
Browse files Browse the repository at this point in the history
  • Loading branch information
Flamefire committed Dec 20, 2023
1 parent 2816bf8 commit 03d02e6
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion test/framework/utilities_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,15 @@ def test_LooseVersion(self):
self.assertLess(LooseVersion('1.02'), '2.01')
self.assertLessEqual('1.02', LooseVersion('2.01'))
self.assertLessEqual(LooseVersion('1.02'), '2.01')
# Negation of all ops, i.e. verify each op can return False
self.assertFalse(LooseVersion('2.02') != '2.02')
self.assertFalse(LooseVersion('2.02') <= '2.01')
self.assertFalse(LooseVersion('2.02') < '2.01')
self.assertFalse(LooseVersion('2.02') < '2.02')
self.assertFalse(LooseVersion('2.02') == '2.03')
self.assertFalse(LooseVersion('2.02') >= '2.03')
self.assertFalse(LooseVersion('2.02') > '2.03')
self.assertFalse(LooseVersion('2.02') > '2.02')

# Some comparisons we might do: Full version on left hand side, shorter on right
self.assertGreater(LooseVersion('2.1.5'), LooseVersion('2.1'))
Expand All @@ -135,7 +144,7 @@ def test_LooseVersion(self):
self.assertGreater(LooseVersion('1.0'), LooseVersion('1'))
self.assertLess(LooseVersion('1'), LooseVersion('1.0'))

# The following test is taken from Python disutils tests
# The following test is taken from Python distutils tests
# licensed under the Python Software Foundation License Version 2
versions = (('1.5.1', '1.5.2b2', -1),
('161', '3.10a', 1),
Expand Down

0 comments on commit 03d02e6

Please sign in to comment.