README_DOCS.rst: update tg prev and tg next usage summary
[topgit/pro.git] / t / t8000-git-mailinfo-bug.sh
blob22a2172836754ae419e26dc8e876342266c26c06
1 #!/bin/sh
3 TEST_NO_CREATE_REPO=1
5 test_description='Test for git mailinfo -b bug
7 1 - git mailinfo (default)
9 2 - git mailinfo -k (keep everything)
11 3,4,5,6,7 - git mailinfo -b (blast blanks and [PATCH] tags)
13 This last can easily be made to fatal out (6 & 7)
16 . ./test-lib.sh
18 test_plan 7
20 test_expect_success 'git mailinfo no options' '
21 subj="$(echo "Subject: [PATCH] [other] [PATCH] message" |
22 git mailinfo /dev/null /dev/null)" &&
23 test z"$subj" = z"Subject: message"
26 test_expect_success 'git mailinfo -k' '
27 subj="$(echo "Subject: [PATCH] [other] [PATCH] message" |
28 git mailinfo -k /dev/null /dev/null)" &&
29 test z"$subj" = z"Subject: [PATCH] [other] [PATCH] message"
32 test_expect_success 'git mailinfo -b no [PATCH]' '
33 subj="$(echo "Subject: [other] message" |
34 git mailinfo -b /dev/null /dev/null)" &&
35 test z"$subj" = z"Subject: [other] message"
38 test_expect_success 'git mailinfo -b leading [PATCH]' '
39 subj="$(echo "Subject: [PATCH] [other] message" |
40 git mailinfo -b /dev/null /dev/null)" &&
41 test z"$subj" = z"Subject: [other] message"
44 test_expect_success 'git mailinfo -b double [PATCH]' '
45 subj="$(echo "Subject: [PATCH] [PATCH] message" |
46 git mailinfo -b /dev/null /dev/null)" &&
47 test z"$subj" = z"Subject: message"
50 test_expect_failure 'git mailinfo -b trailing [PATCH]' '
51 subj="$(echo "Subject: [other] [PATCH] message" |
52 git mailinfo -b /dev/null /dev/null)" &&
53 test z"$subj" = z"Subject: [other] message"
56 test_expect_failure 'git mailinfo -b separated double [PATCH]' '
57 subj="$(echo "Subject: [PATCH] [other] [PATCH] message" |
58 git mailinfo -b /dev/null /dev/null)" &&
59 test z"$subj" = z"Subject: [other] message"
62 test_done