diff options
author | Jon Turney <jon.turney@dronecode.org.uk> | 2017-10-04 17:41:41 +0300 |
---|---|---|
committer | Jon Turney <jon.turney@dronecode.org.uk> | 2017-10-06 14:35:42 +0300 |
commit | 3673949b6259839db7526584efbe8de432d41db4 (patch) | |
tree | 4a083f6dc3e900f4783355860f06a4dd0d6118d6 | |
parent | 3e00aa05586a70468332fe280678ed6a2f6ea9c4 (diff) |
Add more version comparision tests
Test data taken from RPM
-rwxr-xr-x | test/test_calm.py | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/test/test_calm.py b/test/test_calm.py index d1cf3af..805b7d7 100755 --- a/test/test_calm.py +++ b/test/test_calm.py @@ -172,6 +172,68 @@ class CalmTest(unittest.TestCase): ["2a", "2.0", -1], ["1.0", "1.fc4", 1], ["3.0.0_fc", "3.0.0.fc", 0], + # from RPM tests + ["1.0", "1.0", 0], + ["1.0", "2.0", -1], + ["2.0", "1.0", 1], + ["2.0.1", "2.0.1", 0], + ["2.0", "2.0.1", -1], + ["2.0.1", "2.0", 1], + ["2.0.1a", "2.0.1a", 0], + ["2.0.1a", "2.0.1", 1], + ["2.0.1", "2.0.1a", -1], + ["5.5p1", "5.5p1", 0], + ["5.5p1", "5.5p2", -1], + ["5.5p2", "5.5p1", 1], + ["5.5p10", "5.5p10", 0], + ["5.5p1", "5.5p10", -1], + ["5.5p10", "5.5p1", 1], + ["10xyz", "10.1xyz", -1], + ["10.1xyz", "10xyz", 1], + ["xyz10", "xyz10", 0], + ["xyz10", "xyz10.1", -1], + ["xyz10.1", "xyz10", 1], + ["xyz.4", "xyz.4", 0], + ["xyz.4", "8", -1], + ["8", "xyz.4", 1], + ["xyz.4", "2", -1], + ["2", "xyz.4", 1], + ["5.5p2", "5.6p1", -1], + ["5.6p1", "5.5p2", 1], + ["5.6p1", "6.5p1", -1], + ["6.5p1", "5.6p1", 1], + ["6.0.rc1", "6.0", 1], + ["6.0", "6.0.rc1", -1], + ["10b2", "10a1", 1], + ["10a2", "10b2", -1], + ["1.0aa", "1.0aa", 0], + ["1.0a", "1.0aa", -1], + ["1.0aa", "1.0a", 1], + ["10.0001", "10.0001", 0], + ["10.0001", "10.1", 0], + ["10.1", "10.0001", 0], + ["10.0001", "10.0039", -1], + ["10.0039", "10.0001", 1], + ["4.999.9", "5.0", -1], + ["5.0", "4.999.9", 1], + ["20101121", "20101121", 0], + ["20101121", "20101122", -1], + ["20101122", "20101121", 1], + ["2_0", "2_0", 0], + ["2.0", "2_0", 0], + ["2_0", "2.0", 0], + ["a", "a", 0], + ["a+", "a+", 0], + ["a+", "a_", 0], + ["a_", "a+", 0], + ["+a", "+a", 0], + ["+a", "_a", 0], + ["_a", "+a", 0], + ["+_", "+_", 0], + ["_+", "+_", 0], + ["_+", "_+", 0], + ["+", "_", 0], + ["_", "+", 0], ] for d in test_data: |