Re: [PATCH] tests: make sure rename pretty print works
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 3, 2013, 06:50 UTC
- Message-ID
- <7vehfxc6yt.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <1362235092-16914-1-git-send-email-apelisse@gmail.com>
Antoine Pelisse <apelisse@gmail.com> writes:
Show 8 quoted lines
> Add basic use cases and corner cases tests for > "git diff -M --summary/stat". > > Signed-off-by: Antoine Pelisse <apelisse@gmail.com> > --- > t/t4056-rename-pretty.sh | 54 ++++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 54 insertions(+) > create mode 100755 t/t4056-rename-pretty.sh
I wonder if this needs a new test script of its own.
If we anticipate future additions, it would make sense but otherwise it may be better if we can find an existing one these tests can be folded into.
Show 11 quoted lines
> diff --git a/t/t4056-rename-pretty.sh b/t/t4056-rename-pretty.sh > new file mode 100755 > index 0000000..806046f > --- /dev/null > +++ b/t/t4056-rename-pretty.sh > @@ -0,0 +1,54 @@ > +#!/bin/sh > + > +test_description='Rename pretty print > + > +'
A single line would be sufficient...
Show 5 quoted lines
> +test_expect_success common_prefix ' > + mkdir -p c/d && > + git mv c/b/a c/d/e && > + git commit -m. && > + git show -M --summary >output &&
I guess the unsightly "commit -m." is an attempt to prevent the later grep from matching log message randomly, but if you test the output from "git diff -M --stat/summary HEAD^ HEAD" you do not have to worry about it, no?
Also I wonder if we can verify the filename part in --stat output.
> + test_i18ngrep "c/{b/a => d/e}" outputWe would want to make sure that we do not have random cruft around the paths, and the byte before that 'c' and after that '}' may want to be verified.