Re: [PATCH v2 4/4] t4033-diff-patience: factor out tests

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Tay Ray Chuan <rctay89@xxxxxxxxx> writes:

> Group the test cases into two functions, test_diff_(frobnitz|unique).
> This in preparation for the histogram diff algorithm, which would also
> re-use these test cases.
>
> Signed-off-by: Tay Ray Chuan <rctay89@xxxxxxxxx>
> ---
>
> Ram: the rename is detected in git-log, but not in the diffstat. The
> expected and actual content, which makes up the bulk of content, is
> unchanged, but the 'surrounding' changes should be pretty easy to spot.
>
>  t/lib-diff-patience.sh   |  163 ++++++++++++++++++++++++++++++++++++++++++++++

Perhaps name this "t/lib-diff-alternative.sh" (or "strategy"), as this
will soon be for testing non-default diff backend algorithms, not just
patience diff?

>  t/t4033-diff-patience.sh |  162 +--------------------------------------------
>  2 files changed, 166 insertions(+), 159 deletions(-)
>  create mode 100644 t/lib-diff-patience.sh
>
> diff --git a/t/lib-diff-patience.sh b/t/lib-diff-patience.sh
> new file mode 100644
> index 0000000..761bb09
> --- /dev/null
> +++ b/t/lib-diff-patience.sh
> @@ -0,0 +1,163 @@
> ...
> +	STRATEGY=$1
> +
> +	test_expect_success "$STRATEGY diff" '
> +		test_must_fail git diff --no-index "--$STRATEGY" file1 file2 > output &&
> +		test_cmp expect output
> +	'
> +
> +	test_expect_success "$STRATEGY diff output is valid" '
> +		mv file2 expect &&
> +		git apply < output &&
> +		test_cmp expect file2
> +	'
> +}
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]