Re: t9000-addresses.sh: unexpected pases

3 messages, 2 authors, 2016-10-21 · open the first message on its own page

Re: t9000-addresses.sh: unexpected pases

From: Junio C Hamano <hidden>
Date: 2016-10-21 00:50:15

Ramsay Jones [off-list ref] writes:
I have started seeing unexpected passes in this test (am I the
only one?) on the next and pu branch, which seems to be caused
by commit e3fdbcc8 ("parse_mailboxes: accept extra text after
<...> address", 13-10-2016). Thus:

  $ tail -15 ntest-out
  [15:17:44]
  All tests successful.

  Test Summary Report
  -------------------
  t9000-addresses.sh                               (Wstat: 0 Tests: 37 Failed: 0)
    TODO passed:   28, 30-31
Yeah, I noticed this in some of my integration runs but didn't pay
attention and forgot about it; thanks for bringing it up.

[PATCH 1/2] t9000-addresses: update expected results after fix

From: Matthieu Moy <hidden>
Date: 2016-10-21 09:21:10

e3fdbcc8e1 (parse_mailboxes: accept extra text after <...> address,
2016-10-13) improved our in-house address parser and made it closer to
Mail::Address. As a consequence, some tests comparing it to
Mail::Address now pass, but e3fdbcc8e1 forgot to update the test.

Signed-off-by: Matthieu Moy <redacted>
---
 t/t9000/test.pl | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/t/t9000/test.pl b/t/t9000/test.pl
index 2d05d3eeab..dfeaa9c655 100755
--- a/t/t9000/test.pl
+++ b/t/t9000/test.pl
@@ -32,15 +32,15 @@ my @success_list = (q[Jane],
 	q["Jane\" Doe" <jdoe@example.com>],
 	q[Doe, jane <jdoe@example.com>],
 	q["Jane Doe <jdoe@example.com>],
-	q['Jane 'Doe' <jdoe@example.com>]);
+	q['Jane 'Doe' <jdoe@example.com>],
+	q[Jane@:;\.,()<>Doe <jdoe@example.com>],
+	q[Jane <jdoe@example.com> Doe],
+	q[<jdoe@example.com> Jane Doe]);
 
 my @known_failure_list = (q[Jane\ Doe <jdoe@example.com>],
 	q["Doe, Ja"ne <jdoe@example.com>],
 	q["Doe, Katarina" Jane <jdoe@example.com>],
-	q[Jane@:;\.,()<>Doe <jdoe@example.com>],
 	q[Jane jdoe@example.com],
-	q[<jdoe@example.com> Jane Doe],
-	q[Jane <jdoe@example.com> Doe],
 	q["Jane "Kat"a" ri"na" ",Doe" <jdoe@example.com>],
 	q[Jane Doe],
 	q[Jane "Doe <jdoe@example.com>"],
-- 
2.10.1.651.gffd0de0

[PATCH 2/2] Git.pm: add comment pointing to t9000

From: Matthieu Moy <hidden>
Date: 2016-10-21 09:34:46

parse_mailboxes should probably eventually be completely equivalent to
Mail::Address, and if this happens we can drop the Mail::Address
dependency. Add a comment in the code reminding the current state of the
code, and point to the corresponding failing test to help future
contributors to get it right.

Signed-off-by: Matthieu Moy <redacted>
---
 perl/Git.pm | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/perl/Git.pm b/perl/Git.pm
index 42e0895ef7..8bb2b7c7e3 100644
--- a/perl/Git.pm
+++ b/perl/Git.pm
@@ -870,6 +870,8 @@ Return an array of mailboxes extracted from a string.
 
 =cut
 
+# Very close to Mail::Address's parser, but we still have minor
+# differences in some cases (see t9000 for examples).
 sub parse_mailboxes {
 	my $re_comment = qr/\((?:[^)]*)\)/;
 	my $re_quote = qr/"(?:[^\"\\]|\\.)*"/;
-- 
2.10.1.651.gffd0de0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help