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
Jonathan Nieder <jrnieder@gmail.com>
Date
Nov 8, 2010, 21:38 UTC
Message-ID
<20101108213844.GB13114@burratino>
In-Reply-To
<AANLkTik48HPHn4Xfwn5kuS2uHenQfjTJFaXMe9iSe5vU@mail.gmail.com>
Ævar Arnfjörð Bjarmason wrote:
Show 12 quoted lines
>>  The alternative would be to use 3 = $(wc -l) (sans quotes), but other parts
>>  of the test used the -eq method.
>
> A IMO saner alternative is to add a new test-lib.sh function for this.
> 
> E.g.:
> 
> -       test 3 = "$(git ls-files -u | wc -l)" &&
> -       test_wc 3 "git ls-files -u" &&
> 
> We could use test_cmp or something internally so we'd get meaningful
> output when those tests fail.

See http://thread.gmane.org/gmane.comp.version-control.git/157903/focus=160421 for example.

Previous: Ævar Arnfjörð BjarmasonNext: Junio C Hamano
Message 3 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.