Re: [PATCH 3/6] t1006 (cat-file): use test_cmp
Ramkumar Ramachandra <artagnon@gmail.com> writes:
Show 32 quoted lines
> In testing, a common paradigm involves checking the expected output
> with the actual output: test-lib provides a test_cmp to show the diff
> between the two outputs. So, use this function in preference to
> calling a human over to compare command outputs by eye.
>
> Helped-by: Jonathan Nieder <jrnieder@gmail.com>
> Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
> ---
> t/t1006-cat-file.sh | 119 ++++++++++++++++++++++++---------------------------
> 1 files changed, 56 insertions(+), 63 deletions(-)
>
> diff --git a/t/t1006-cat-file.sh b/t/t1006-cat-file.sh
> index d8b7f2f..5be3ce9 100755
> --- a/t/t1006-cat-file.sh
> +++ b/t/t1006-cat-file.sh
> @@ -144,10 +119,13 @@ tag_size=$(strlen "$tag_content")
>
> run_tests 'tag' $tag_sha1 $tag_size "$tag_content" "$tag_pretty_content" 1
>
> -test_expect_success \
> - "Reach a blob from a tag pointing to it" \
> - "test '$hello_content' = \"\$(git cat-file blob $tag_sha1)\""
> +test_expect_success "Reach a blob from a tag pointing to it" '
> + echo_without_newline "$hello_content" >expect &&
> + git cat-file blob "$tag_sha1" >actual &&
> + test_cmp expect actual
> +'
>
> +test_done
> for batch in batch batch-check
> do
> for opt in t s e p
What is that test_done about?