summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-08-23 01:49:29 -0500
committerDan McGee <dan@archlinux.org>2011-08-23 01:49:29 -0500
commit30d978a966c1d2a619acc49f204e4da1e0010c83 (patch)
tree213655259e062d4603b4f665ddc4f9941280c92c /test
parentcc03d6366a12cd1926e46265c63fba98f41faaae (diff)
downloadpacman-30d978a966c1d2a619acc49f204e4da1e0010c83.tar.xz
vercmp: ensure 2.0a and 2.0.a do not compare equal
We had this interesting set of facts conundrum, according to vercmp return values: 2.0a < 2.0 2.0 < 2.0.a 2.0a == 2.0.a This introduces a code change that ensures '2.0a < 2.0.a' as would be expected by the first two comparisons. Unfortunately this stays us a bit further from upstream RPM code, but those are the breaks (in RPM, the versions involving 'a' do in fact compare the same, but they are both greater than the bare '2.0'). Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'test')
-rwxr-xr-xtest/util/vercmptest.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/util/vercmptest.sh b/test/util/vercmptest.sh
index 54ede04b..6b4bcbc2 100755
--- a/test/util/vercmptest.sh
+++ b/test/util/vercmptest.sh
@@ -118,6 +118,12 @@ runtest 1.5.1 1.5.b 1
runtest 1.5.b-1 1.5.b 0
runtest 1.5-1 1.5.b -1
+# same/similar content, differing separators
+runtest 2.0 2_0 0
+runtest 2.0_a 2_0.a 0
+runtest 2.0a 2.0.a -1
+runtest 2___a 2_a 1
+
# epoch included version comparisons
runtest 0:1.0 0:1.0 0
runtest 0:1.0 0:1.1 -1