Re: [PATCH] t6022: Use -eq not = to test output of wc -l
- From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
- Date
- Nov 8, 2010, 21:35 UTC
- Message-ID
- <AANLkTik48HPHn4Xfwn5kuS2uHenQfjTJFaXMe9iSe5vU@mail.gmail.com>
- In-Reply-To
- <1289251766-48316-1-git-send-email-brian@gernhardtsoftware.com>
> 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.
But this is a good fix anyway.