aboutsummaryrefslogtreecommitdiff
path: root/tests/package-archive
diff options
context:
space:
mode:
Diffstat (limited to 'tests/package-archive')
-rw-r--r--tests/package-archive/driver.in10
-rw-r--r--tests/package-archive/testscript20
2 files changed, 17 insertions, 13 deletions
diff --git a/tests/package-archive/driver.in b/tests/package-archive/driver.in
index a32e571..5adecf1 100644
--- a/tests/package-archive/driver.in
+++ b/tests/package-archive/driver.in
@@ -8,13 +8,13 @@
bpkg_util_bpkg=bpkg
trap "{ exit 1; }" ERR
-set -o errtrace # Trap ERR in functions.
+set -o errtrace # Trap in functions and subshells.
+set -o pipefail # Fail if any pipeline command fails.
+shopt -s lastpipe # Execute last pipeline command in the current shell.
+shopt -s nullglob # Expand no-match globs to nothing rather than themselves.
@import bpkg-util/package-archive@
# Call the function passed on the command line.
#
-# Note that we reset IFS to make sure that the function being tested is not
-# affected by its value set by the caller.
-#
-IFS= "$@"
+"$@"
diff --git a/tests/package-archive/testscript b/tests/package-archive/testscript
index b2eb7e3..75df25a 100644
--- a/tests/package-archive/testscript
+++ b/tests/package-archive/testscript
@@ -6,7 +6,7 @@
# find utility to fail with the 'no such file or directory' error. Thus, we
# clone the archives into the test working directories and search there.
#
-clone_arcs = \
+clone_arcs = [cmdline] \
cp $src_base/libhello-0.1.0.tar.gz $src_base/libhello-0.1.0+1.tar.gz ./
: pkg-verify-archive
@@ -22,7 +22,11 @@ clone_arcs = \
: success
:
- $* $src_base/libhello-0.1.0.tar.gz >:'libhello 0.1.0 hello'
+ $* $src_base/libhello-0.1.0.tar.gz >>EOO
+ libhello
+ 0.1.0
+ hello
+ EOO
}
: pkg-find-archives
@@ -43,7 +47,7 @@ clone_arcs = \
{
$clone_arcs;
- $* 'libhello' '*' $~ >>:/~"%EOO%"
+ $* 'libhello' '*' $~ >>/~"%EOO%"
%\(
$~/libhello-0.1.0.tar.gz
$~/libhello-0.1.0+1.tar.gz
@@ -59,7 +63,7 @@ clone_arcs = \
{
$clone_arcs;
- $* 'libhello' '0.1.0' $~ >:/"$~/libhello-0.1.0.tar.gz"
+ $* 'libhello' '0.1.0' $~ >/"$~/libhello-0.1.0.tar.gz"
}
: package-revision
@@ -67,7 +71,7 @@ clone_arcs = \
{
$clone_arcs;
- $* 'libhello' '0.1.0+1' $~ >:/"$~/libhello-0.1.0+1.tar.gz"
+ $* 'libhello' '0.1.0+1' $~ >/"$~/libhello-0.1.0+1.tar.gz"
}
: package-revisions1
@@ -75,7 +79,7 @@ clone_arcs = \
{
$clone_arcs;
- $* 'libhello' '0.1.0*' $~ >>:/~"%EOO%"
+ $* 'libhello' '0.1.0*' $~ >>/~"%EOO%"
%\(
$~/libhello-0.1.0.tar.gz
$~/libhello-0.1.0+1.tar.gz
@@ -91,7 +95,7 @@ clone_arcs = \
{
$clone_arcs;
- $* 'libhello' '0.1.0+2*' $~ >>:/~"%EOO%"
+ $* 'libhello' '0.1.0+2*' $~ >>/~"%EOO%"
%\(
$~/libhello-0.1.0.tar.gz
$~/libhello-0.1.0+1.tar.gz
@@ -117,7 +121,7 @@ clone_arcs = \
{
$clone_arcs;
- $* 'libhello-0.1.0.*' $~ >>:/"EOO"
+ $* 'libhello-0.1.0.*' $~ >>/"EOO"
$~/libhello-0.1.0.tar.gz
libhello
0.1.0