git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 6, 2011, 18:04 UTC
Message-ID
<7vhb6zmgkg.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1309970337-6016-5-git-send-email-rctay89@gmail.com>
Tay Ray Chuan <rctay89@gmail.com> writes:
Show 12 quoted lines
> 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@gmail.com>
> ---
>
> 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?

Show 24 quoted lines
>  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
> +	'
> +}
Previous: Tay Ray ChuanNext: Junio C Hamano
Message 6 of 16 in “prepare for histogram diff”
  1. 0/4 prepare for histogram diffTay Ray Chuan, Jul 6, 2011
  2. 1/4 xdiff/xprepare: use memset()Tay Ray Chuan, Jul 6, 2011
  3. 2/4 xdiff/xprepare: refactor abort cleanupsTay Ray Chuan, Jul 6, 2011
  4. 3/4 xdiff/xpatience: factor out fall-back-diff functionTay Ray Chuan, Jul 6, 2011
  5. 4/4 t4033-diff-patience: factor out testsTay Ray Chuan, Jul 6, 2011
  6. Junio C HamanoJul 6, 2011
  7. Junio C HamanoJul 6, 2011
  8. Tay Ray ChuanJul 6, 2011
  9. Junio C HamanoJul 6, 2011
  10. Phil HordJul 7, 2011
  11. Tay Ray ChuanJul 7, 2011
  12. 0/4 prepare for histogram diffTay Ray Chuan, Jul 7, 2011
  13. 1/4 xdiff/xprepare: use memset()Tay Ray Chuan, Jul 7, 2011
  14. 2/4 xdiff/xprepare: refactor abort cleanupsTay Ray Chuan, Jul 7, 2011
  15. 3/4 xdiff/xpatience: factor out fall-back-diff functionTay Ray Chuan, Jul 7, 2011
  16. 4/4 t4033-diff-patience: factor out testsTay Ray Chuan, Jul 7, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.