summaryrefslogtreecommitdiff
path: root/tests/test_spec.py
diff options
context:
space:
mode:
authorRaphaël Barrois <raphael.barrois@polytechnique.org>2015-09-15 23:18:13 +0200
committerRaphaël Barrois <raphael.barrois@polytechnique.org>2015-09-15 23:40:59 +0200
commit2ed3d39c291080c61edd9139370939e1fdc3209a (patch)
tree22a90dfae0e0fc9fd7949ca18e7e47daa8f8aabb /tests/test_spec.py
parent4aac5768db2fc158fa87900b54210ecba4dfe6d5 (diff)
downloadsemantic-version-2ed3d39c291080c61edd9139370939e1fdc3209a.tar.gz
Forbid build metadata ordering (See #18)
SemVer 2.0.0 states that "Build metadata SHOULD be ignored when determining version precedence". This means that, when comparing ``0.1.0+1`` to ``0.1.0+bcd``:: >>> Version('0.1.0+1') == Version('0.1.0+bcd') False >>> Version('0.1.0+1') != Version('0.1.0+bcd') True >>> Version('0.1.0+1') < Version('0.1.0+bcd') False >>> Version('0.1.0+1') > Version('0.1.0+bcd') False >>> Version('0.1.0+1') <= Version('0.1.0+bcd') False >>> Version('0.1.0+1') >= Version('0.1.0+bcd') False >>> compare(Version('0.1.0+1'), Version('0.1.0+bcd')) NotImplemented This change also has the following effects: - When including build metadata in a ``Spec``, the only valid options are ``Spec('==0.1.0+sth')`` and ``Spec('!=0.1.0+sth')`` - The meaning of ``Spec('==0.1.0+')`` is now "Only version 0.1.0 without build metadata" - ``Spec('==0.1.0')`` now matches ``Version('0.1.0+anything')``
Diffstat (limited to 'tests/test_spec.py')
-rw-r--r--tests/test_spec.py7
1 files changed, 0 insertions, 7 deletions
diff --git a/tests/test_spec.py b/tests/test_spec.py
index 7a645f9..a13cb0b 100644
--- a/tests/test_spec.py
+++ b/tests/test_spec.py
@@ -154,10 +154,3 @@ class FormatTests(unittest.TestCase):
self.assertLess(Version('1.0.0-beta.2'), Version('1.0.0-beta.11'))
self.assertLess(Version('1.0.0-beta.11'), Version('1.0.0-rc.1'))
self.assertLess(Version('1.0.0-rc.1'), Version('1.0.0'))
-
-
-
-class PrecedenceTestCase(unittest.TestCase):
- pass
-
-