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 > + ' > +}