Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/test/util/vercmptest.sh
diff options
context:
space:
mode:
authorAndrew Gregory <andrew.gregory.8@gmail.com>2014-12-23 16:16:08 -0500
committerAllan McRae <allan@archlinux.org>2014-12-28 13:06:39 +1000
commitf1e010a5a7c562da02a74ffb043520760db49ba3 (patch)
tree5a9feb4c8d6a23e5410ab9da0cbf43b15e2485e3 /test/util/vercmptest.sh
parent29c0d8233b32ab3ad1dcd7c3bf1161449a386dea (diff)
add tap_ prefix to test helper functions
Allows tap.sh to show the line number where the helper function was called on failures. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'test/util/vercmptest.sh')
-rwxr-xr-xtest/util/vercmptest.sh94
1 files changed, 47 insertions, 47 deletions
diff --git a/test/util/vercmptest.sh b/test/util/vercmptest.sh
index 3f626434..04edb155 100755
--- a/test/util/vercmptest.sh
+++ b/test/util/vercmptest.sh
@@ -31,7 +31,7 @@ fi
# args:
# runtest ver1 ver2 expected
-runtest() {
+tap_runtest() {
local ver1=$1 ver2=$2 exp=$3
tap_is_str "$($bin "$ver1" "$ver2")" "$exp" "$ver1 $ver2"
# and run its mirror case just to be sure
@@ -42,76 +42,76 @@ runtest() {
tap_plan 92
# all similar length, no pkgrel
-runtest 1.5.0 1.5.0 0
-runtest 1.5.1 1.5.0 1
+tap_runtest 1.5.0 1.5.0 0
+tap_runtest 1.5.1 1.5.0 1
# mixed length
-runtest 1.5.1 1.5 1
+tap_runtest 1.5.1 1.5 1
# with pkgrel, simple
-runtest 1.5.0-1 1.5.0-1 0
-runtest 1.5.0-1 1.5.0-2 -1
-runtest 1.5.0-1 1.5.1-1 -1
-runtest 1.5.0-2 1.5.1-1 -1
+tap_runtest 1.5.0-1 1.5.0-1 0
+tap_runtest 1.5.0-1 1.5.0-2 -1
+tap_runtest 1.5.0-1 1.5.1-1 -1
+tap_runtest 1.5.0-2 1.5.1-1 -1
# with pkgrel, mixed lengths
-runtest 1.5-1 1.5.1-1 -1
-runtest 1.5-2 1.5.1-1 -1
-runtest 1.5-2 1.5.1-2 -1
+tap_runtest 1.5-1 1.5.1-1 -1
+tap_runtest 1.5-2 1.5.1-1 -1
+tap_runtest 1.5-2 1.5.1-2 -1
# mixed pkgrel inclusion
-runtest 1.5 1.5-1 0
-runtest 1.5-1 1.5 0
-runtest 1.1-1 1.1 0
-runtest 1.0-1 1.1 -1
-runtest 1.1-1 1.0 1
+tap_runtest 1.5 1.5-1 0
+tap_runtest 1.5-1 1.5 0
+tap_runtest 1.1-1 1.1 0
+tap_runtest 1.0-1 1.1 -1
+tap_runtest 1.1-1 1.0 1
# alphanumeric versions
-runtest 1.5b-1 1.5-1 -1
-runtest 1.5b 1.5 -1
-runtest 1.5b-1 1.5 -1
-runtest 1.5b 1.5.1 -1
+tap_runtest 1.5b-1 1.5-1 -1
+tap_runtest 1.5b 1.5 -1
+tap_runtest 1.5b-1 1.5 -1
+tap_runtest 1.5b 1.5.1 -1
# from the manpage
-runtest 1.0a 1.0alpha -1
-runtest 1.0alpha 1.0b -1
-runtest 1.0b 1.0beta -1
-runtest 1.0beta 1.0rc -1
-runtest 1.0rc 1.0 -1
+tap_runtest 1.0a 1.0alpha -1
+tap_runtest 1.0alpha 1.0b -1
+tap_runtest 1.0b 1.0beta -1
+tap_runtest 1.0beta 1.0rc -1
+tap_runtest 1.0rc 1.0 -1
# going crazy? alpha-dotted versions
-runtest 1.5.a 1.5 1
-runtest 1.5.b 1.5.a 1
-runtest 1.5.1 1.5.b 1
+tap_runtest 1.5.a 1.5 1
+tap_runtest 1.5.b 1.5.a 1
+tap_runtest 1.5.1 1.5.b 1
# alpha dots and dashes
-runtest 1.5.b-1 1.5.b 0
-runtest 1.5-1 1.5.b -1
+tap_runtest 1.5.b-1 1.5.b 0
+tap_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
+tap_runtest 2.0 2_0 0
+tap_runtest 2.0_a 2_0.a 0
+tap_runtest 2.0a 2.0.a -1
+tap_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
-runtest 1:1.0 0:1.0 1
-runtest 1:1.0 0:1.1 1
-runtest 1:1.0 2:1.1 -1
+tap_runtest 0:1.0 0:1.0 0
+tap_runtest 0:1.0 0:1.1 -1
+tap_runtest 1:1.0 0:1.0 1
+tap_runtest 1:1.0 0:1.1 1
+tap_runtest 1:1.0 2:1.1 -1
# epoch + sometimes present pkgrel
-runtest 1:1.0 0:1.0-1 1
-runtest 1:1.0-1 0:1.1-1 1
+tap_runtest 1:1.0 0:1.0-1 1
+tap_runtest 1:1.0-1 0:1.1-1 1
# epoch included on one version
-runtest 0:1.0 1.0 0
-runtest 0:1.0 1.1 -1
-runtest 0:1.1 1.0 1
-runtest 1:1.0 1.0 1
-runtest 1:1.0 1.1 1
-runtest 1:1.1 1.1 1
+tap_runtest 0:1.0 1.0 0
+tap_runtest 0:1.0 1.1 -1
+tap_runtest 0:1.1 1.0 1
+tap_runtest 1:1.0 1.0 1
+tap_runtest 1:1.0 1.1 1
+tap_runtest 1:1.1 1.1 1
tap_finish