git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Bert Wesarg <bert.wesarg@googlemail.com>
Date
Nov 16, 2010, 06:46 UTC
Message-ID
<AANLkTinZVw4aB3VVxrELQgdaLZyCLzpeWgMTkxwVY+Mt@mail.gmail.com>
In-Reply-To
<7vaalajkiq.fsf@alter.siamese.dyndns.org>
On Mon, Nov 15, 2010 at 23:21, Junio C Hamano <gitster@pobox.com> wrote:
Show 16 quoted lines
> 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
Previous: Junio C HamanoNext: Johannes Sixt
Message 5 of 9 in “t6022: Use -eq not = to test output of wc -l”
  1. t6022: Use -eq not = to test output of wc -lBrian Gernhardt, Nov 8, 2010
  2. Ævar Arnfjörð BjarmasonNov 8, 2010
  3. Jonathan NiederNov 8, 2010
  4. Junio C HamanoNov 15, 2010
  5. Bert WesargNov 16, 2010
  6. Johannes SixtNov 16, 2010
  7. Jonathan NiederNov 16, 2010
  8. Junio C HamanoNov 16, 2010
  9. Jonathan NiederNov 16, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.