From: Junio C Hamano Date: Tue, 18 Jan 2011 18:00:57 GMT Subject: Re*: [PATCH 1/3] t4034: bulk verify builtin word regex sanity Message-ID: <7voc7eks6e.fsf_-_@alter.siamese.dyndns.org> In-Reply-To: <20110111214811.GB29133@burratino> Jonathan Nieder writes: > From: Thomas Rast > Date: Sat, 18 Dec 2010 17:17:54 +0100 > > The builtin word regexes should be tested with some simple examples > against simple issues. Do this in bulk. Thanks. > diff --git a/t/t4034/bibtex/expect b/t/t4034/bibtex/expect > new file mode 100644 > index 0000000..a157774 > --- /dev/null > +++ b/t/t4034/bibtex/expect > @@ -0,0 +1,15 @@ > +diff --git a/pre b/post > +index 95cd55b..ddcba9b 100644 Having to change this line every time the test input (or output) has changed is somewhat unfortunate. Also I noticed that "word_diff" shell function has this: test_must_fail git diff --no-index "$@" pre post >output && which solicits two comments: - We do not seem to document that --no-index implies --exit-code, ever since the latter option was introduced at 41bbf9d (Allow git-diff exit with codes similar to diff(1), 2007-03-14). Probably we should. - This assumes that no test vector would have identical pre/post pair that expects no output, which feels somewhat limiting. What we care about in this test is that "git diff --no-index" does not die an uncontrolled death, so test_might_fail may be more appropriate. Here is another that probably should be squashed to this patch together with 3/3 to add tests for the perl driver (I noticed it only because 2/3 had trivial conflict due to recent addition of it). -- >8 -- From: Junio C Hamano Date: Tue, 18 Jan 2011 09:43:43 -0800 Subject: [PATCH] t4034 (diff --word-diff): add a minimum Perl drier test vector Signed-off-by: Junio C Hamano --- t/t4034-diff-words.sh | 1 + t/t4034/perl/expect | 13 +++++++++++++ t/t4034/perl/post | 22 ++++++++++++++++++++++ t/t4034/perl/pre | 22 ++++++++++++++++++++++ 4 files changed, 58 insertions(+), 0 deletions(-) create mode 100644 t/t4034/perl/expect create mode 100644 t/t4034/perl/post create mode 100644 t/t4034/perl/pre diff --git a/t/t4034-diff-words.sh b/t/t4034-diff-words.sh index c3b1c48..37aeab0 100755 --- a/t/t4034-diff-words.sh +++ b/t/t4034-diff-words.sh @@ -301,6 +301,7 @@ test_language_driver html test_language_driver java test_language_driver objc test_language_driver pascal +test_language_driver perl test_language_driver php test_language_driver python test_language_driver ruby diff --git a/t/t4034/perl/expect b/t/t4034/perl/expect new file mode 100644 index 0000000..a1deb6b --- /dev/null +++ b/t/t4034/perl/expect @@ -0,0 +1,13 @@ +diff --git a/pre b/post +index f6610d3..e8b72ef 100644 +--- a/pre ++++ b/post +@@ -4,8 +4,8 @@ + +package Frotz; +sub new { + my ($class, %opts) = shift@_; + return bless { xyzzy => "nitfol", %opts }, $class; +} + +__END__ diff --git a/t/t4034/perl/post b/t/t4034/perl/post new file mode 100644 index 0000000..e8b72ef --- /dev/null +++ b/t/t4034/perl/post @@ -0,0 +1,22 @@ +#!/usr/bin/perl + +use strict; + +package Frotz; +sub new { + my ($class, %opts) = @_; + return bless { xyzzy => "nitfol", %opts }, $class; +} + +__END__ +=head1 NAME + +frotz - Frotz + +=head1 SYNOPSIS + + use frotz; + + $nitfol = new Frotz(); + +=cut diff --git a/t/t4034/perl/pre b/t/t4034/perl/pre new file mode 100644 index 0000000..f6610d3 --- /dev/null +++ b/t/t4034/perl/pre @@ -0,0 +1,22 @@ +#!/usr/bin/perl + +use strict; + +package Frotz; +sub new { + my $class = shift; + return bless {}, $class; +} + +__END__ +=head1 NAME + +frotz - Frotz + +=head1 SYNOPSIS + + use frotz; + + $nitfol = new Frotz(); + +=cut -- 1.7.4.rc2.226.g63d9a