Re: [PATCH 3/7] completion: add tests for the __gitcomp_nl() completion helper function
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Nov 17, 2012, 23:31 UTC
- Message-ID
- <20121117233154.GC3815@elie.Belkin>
- In-Reply-To
- <1353150353-29874-4-git-send-email-szeder@ira.uka.de>
SZEDER Gábor wrote:
Show 8 quoted lines
> --- a/t/t9902-completion.sh > +++ b/t/t9902-completion.sh > @@ -155,6 +155,90 @@ test_expect_success '__gitcomp - suffix' ' > test_cmp expected out > ' > > +test_expect_success '__gitcomp_nl - trailing space' ' > + sed -e "s/Z$//" >expected <<-\EOF &&
'$' is usually a shell metacharacter, so it would be more comfortable to read a version that escapes it:
sed -e "s/Z\$//" >expected <<-\EOF
Since '$/' is not a valid parameter expansion, if I understand correctly then POSIX leaves the meaning of the quoted string "s/Z$//" undefined (XCU §2.2.3). Luckily every shell I've tried, including bash, keeps the $ unmolested.
Other parts of the file already use the same style, so I wouldn't suggest changing it in this patch.
Thanks for some nice tests.
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>