All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] [BUG] test_expect_failure mailinfo -b fatals
@ 2017-05-31 10:26 Kyle J. McKay
  0 siblings, 0 replies; only message in thread
From: Kyle J. McKay @ 2017-05-31 10:26 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Git mailing list

This subject line:

> Subject: [other] [PATCH] message

does not get along with the git mailinfo "-b" option.  In fact,
it triggers a fatal bug:

> fatal: `pos + len' is too far after the end of the buffer

While I did not do any exhaustive checking, I do happen to have
a few builds of various versions of Git lying around and it
fails at least as far back as v1.7.6.  (The -b option was
introduced in v1.6.6 I believe.)

At the very least this is now a "known breakage", so might
as well have the tests for it.

If someone comes along and fixes it it's a simple matter
to flip them to test_expect_success instead.

--Kyle

P.S. Oh yes, the real patch subject is below (love those >8).

-- 8< --
Subject: [PATCH] t5100: add some more mailinfo tests

Add some more simple mailinfo tests including a few that
produce:

  fatal: `pos + len' is too far after the end of the buffer

Mark those as 'test_expect_failure'.

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
---

Notes:
    checking known breakage:
    	subj="$(echo "Subject: [other] [PATCH] message" |
    		git mailinfo -b /dev/null /dev/null)" &&
    	test z"$subj" = z"Subject: [other] message"
    
    fatal: `pos + len' is too far after the end of the buffer
    not ok 46 - mailinfo -b trailing [PATCH] # TODO known breakage
    
    checking known breakage:
    	subj="$(echo "Subject: [PATCH] [other] [PATCH] message" |
    		git mailinfo -b /dev/null /dev/null)" &&
    	test z"$subj" = z"Subject: [other] message"
    
    fatal: `pos + len' is too far after the end of the buffer
    not ok 47 - mailinfo -b separated double [PATCH] # TODO known breakage

 t/t5100-mailinfo.sh | 41 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)

diff --git a/t/t5100-mailinfo.sh b/t/t5100-mailinfo.sh
index 7171f675..333395c8 100755
--- a/t/t5100-mailinfo.sh
+++ b/t/t5100-mailinfo.sh
@@ -170,5 +170,46 @@ test_expect_success 'mailinfo with mailinfo.scissors config' '
 	test_cmp "$DATA/info0014--scissors" info0014.sc
 '
 
+test_expect_success 'mailinfo no options' '
+	subj="$(echo "Subject: [PATCH] [other] [PATCH] message" |
+		git mailinfo /dev/null /dev/null)" &&
+	test z"$subj" = z"Subject: message"
+'
+
+test_expect_success 'mailinfo -k' '
+	subj="$(echo "Subject: [PATCH] [other] [PATCH] message" |
+		git mailinfo -k /dev/null /dev/null)" &&
+	test z"$subj" = z"Subject: [PATCH] [other] [PATCH] message"
+'
+
+test_expect_success 'mailinfo -b no [PATCH]' '
+	subj="$(echo "Subject: [other] message" |
+		git mailinfo -b /dev/null /dev/null)" &&
+	test z"$subj" = z"Subject: [other] message"
+'
+
+test_expect_success 'mailinfo -b leading [PATCH]' '
+	subj="$(echo "Subject: [PATCH] [other] message" |
+		git mailinfo -b /dev/null /dev/null)" &&
+	test z"$subj" = z"Subject: [other] message"
+'
+
+test_expect_success 'mailinfo -b double [PATCH]' '
+	subj="$(echo "Subject: [PATCH] [PATCH] message" |
+		git mailinfo -b /dev/null /dev/null)" &&
+	test z"$subj" = z"Subject: message"
+'
+
+test_expect_failure 'mailinfo -b trailing [PATCH]' '
+	subj="$(echo "Subject: [other] [PATCH] message" |
+		git mailinfo -b /dev/null /dev/null)" &&
+	test z"$subj" = z"Subject: [other] message"
+'
+
+test_expect_failure 'mailinfo -b separated double [PATCH]' '
+	subj="$(echo "Subject: [PATCH] [other] [PATCH] message" |
+		git mailinfo -b /dev/null /dev/null)" &&
+	test z"$subj" = z"Subject: [other] message"
+'
 
 test_done
---

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2017-05-31 10:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-31 10:26 [PATCH] [BUG] test_expect_failure mailinfo -b fatals Kyle J. McKay

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.