Thread (4 messages) flat view 4 messages, 4 authors, 2016-06-15

Re: [PATCH] t6022: Use -eq not = to test output of wc -l

From: Bert Wesarg <hidden>
Date: 2016-06-15 22:50:03

Possibly related (same subject, not in this thread)

On Mon, Nov 15, 2010 at 23:21, Junio C Hamano [off-list ref] wrote:
quoted hunk ↗ jump to hunk
diff --git a/t/test-lib.sh b/t/test-lib.sh
index a417bdf..3088322 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -613,7 +613,10 @@ test_line_count () {
       if test $# != 3
       then
               error "bug in the test script: not 3 parameters to test_line_count"
-       elif ! test $(wc -l <"$3") "$1" "$2"
+       elif    case "$3" in
+               !*)     ! test $( eval "${3#!}" | wc -l ) "$1" "$2" ;;
+               *)      ! test $( wc -l <"$3" ) "$1" "$2" ;;
+               esac
       then
               echo "test_line_count: line count for $3 !$1 $2"
               cat "$3"
This line will fail for the !* case.

Bert
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help