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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Nov 15, 2010 at 23:21, Junio C Hamano <gitster@xxxxxxxxx> wrote:
> 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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]