Re: [PATCH v5 4/4] pretty: test --expand-tabs
On Mon, Apr 4, 2016 at 8:58 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 38 quoted lines
> The test prepares a simple commit with HT on its log message lines,
> and makes sure that
>
> - formats that should or should not expand tabs by default do or do
> not expand tabs respectively,
>
> - with explicit --expand-tabs=<N> and short-hands --expand-tabs
> (equivalent to --expand-tabs=8) and --no-expand-tabs (equivalent
> to --expand-tabs=0) before or after the explicit --pretty=$fmt,
> the tabs are expanded (or not expanded) accordingly.
>
> The tests use the second line of the log message for formats other
> than --pretty=short, primarily because the first line of the email
> format is handled specially to add the [PATCH] prefix, etc. in a
> separate codepath (--pretty=short uses the first line because there
> is no other line to test).
>
> Signed-off-by: Junio C Hamano <gitster@pobox.com>
> ---
> diff --git a/t/t4213-log-tabexpand.sh b/t/t4213-log-tabexpand.sh
> @@ -0,0 +1,98 @@
> +count_expand ()
> +{
> + case " $* " in
> + *' --pretty=short '*)
> + line=$title ;;
> + *)
> + line=$body ;;
> + esac
> + expect=
> + count=$(( $1 + $2 )) ;# expected spaces
> + while test $count -gt 0
> + do
> + expect="$expect "
> + count=$(( $count - 1 ))
> + done
> + shift 2
> + count=$1 ;# expected tabsWhy semicolon before the hash here and above?