Re: [PATCH v2 4/4] t4033-diff-patience: factor out tests
From: Junio C Hamano <hidden>
Date: 2016-06-15 22:51:33
Tay Ray Chuan [off-list ref] 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 <redacted> --- 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?
quoted hunk
t/t4033-diff-patience.sh | 162 +-------------------------------------------- 2 files changed, 166 insertions(+), 159 deletions(-) create mode 100644 t/lib-diff-patience.shdiff --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 + ' +}