summaryrefslogtreecommitdiff
path: root/t/t5100-mailinfo.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-06-22 14:15:22 -0700
committerJunio C Hamano <gitster@pobox.com>2017-06-22 14:15:22 -0700
commit56585a2caf12934382aee9f625e14dca0ba95ab9 (patch)
treefe3768137afb8a23b505a7b8e4bac799858ae90d /t/t5100-mailinfo.sh
parent5779a4aa0e17753009c2aaec43d4ef48be29cf83 (diff)
parentae52d57f0b45b2db93f13c009b7a31108d5d6525 (diff)
downloadgit-56585a2caf12934382aee9f625e14dca0ba95ab9.tar.gz
Merge branch 'km/test-mailinfo-b-failure'
New tests. * km/test-mailinfo-b-failure: t5100: add some more mailinfo tests
Diffstat (limited to 't/t5100-mailinfo.sh')
-rwxr-xr-xt/t5100-mailinfo.sh42
1 files changed, 42 insertions, 0 deletions
diff --git a/t/t5100-mailinfo.sh b/t/t5100-mailinfo.sh
index 7171f67539..9690dcad4f 100755
--- a/t/t5100-mailinfo.sh
+++ b/t/t5100-mailinfo.sh
@@ -171,4 +171,46 @@ test_expect_success 'mailinfo with mailinfo.scissors config' '
'
+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