]> arthur.barton.de Git - bup.git/commitdiff
t/test-on.sh: Don't quote "wc -l" output
authorAlexander Barton <alex@barton.de>
Wed, 25 Feb 2015 14:28:21 +0000 (15:28 +0100)
committerRob Browning <rlb@defaultvalue.org>
Sat, 7 Mar 2015 18:27:57 +0000 (12:27 -0600)
Some wc(1) implementations, for example on OS X, prefix the numeric
output with spaces. So don't quote this output (and don't treat it
as a string) to not confuse WVPASSEQ.

This fixes the following error of "make check":

Comparing:
       2
--
2
! t/test-on.sh:25  ' 2' = '2'                     FAILED
 2.108s ok
called from t/test-on.sh:25 WVPASSEQ        2 2
make[1]: *** [runtests-cmdline] Error 1
! Program returned non-zero exit code (2)         FAILED
WvTest: 3007 tests, 1 failure, total time 84.013s.

Reported by Pedro Estarque, thanks!

Signed-off-by: Alexander Barton <alex@barton.de>
[rlb@defaultvalue.org: adjust commit message; add WVPASS calls]
Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Reviewed-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
t/test-on.sh

index 61e6dd847d037556ef97b5d14965e6581f5b3a30..9943b888850c4ed207e5a08cffaccbecc525a267 100755 (executable)
@@ -22,7 +22,7 @@ WVPASS date > src/bar
 WVPASS bup random 1k > src/baz
 WVPASS bup on - index src
 WVPASS bup on - save -ctn src src > get.log
-WVPASSEQ "$(cat get.log | wc -l)" 2
+WVPASSEQ $(WVPASS cat get.log | WVPASS wc -l) 2
 tree_id=$(WVPASS awk 'FNR == 1' get.log) || exit $?
 commit_id=$(WVPASS awk 'FNR == 2' get.log) || exit $?
 WVPASS git ls-tree "$tree_id"