summaryrefslogtreecommitdiff
path: root/t/t9001-send-email.sh
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2021-04-06 14:00:35 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-04-06 19:57:05 (GMT)
commite585210e1bfc5f948bce99596ea9d5e8a6d5cd81 (patch)
treec9cf0009b921243ae6d607405f733afb6d2f4aae /t/t9001-send-email.sh
parentb362acf575424bcfea6444ce6cbfe3c3aa3f1192 (diff)
downloadgit-e585210e1bfc5f948bce99596ea9d5e8a6d5cd81.zip
git-e585210e1bfc5f948bce99596ea9d5e8a6d5cd81.tar.gz
git-e585210e1bfc5f948bce99596ea9d5e8a6d5cd81.tar.bz2
git-send-email: test full --validate output
Change the tests that grep substrings out of the output to use a full test_cmp, in preparation for improving the output. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t9001-send-email.sh')
-rwxr-xr-xt/t9001-send-email.sh24
1 files changed, 18 insertions, 6 deletions
diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh
index 1a1caf8..74225e3 100755
--- a/t/t9001-send-email.sh
+++ b/t/t9001-send-email.sh
@@ -422,8 +422,12 @@ test_expect_success $PREREQ 'reject long lines' '
--smtp-server="$(pwd)/fake.sendmail" \
--transfer-encoding=8bit \
$patches longline.patch \
- 2>errors &&
- grep longline.patch errors
+ 2>actual &&
+ cat >expect <<-\EOF &&
+ fatal: longline.patch: 35: patch contains a line longer than 998 characters
+ warning: no patches were sent
+ EOF
+ test_cmp expect actual
'
test_expect_success $PREREQ 'no patch was sent' '
@@ -527,9 +531,13 @@ test_expect_success $PREREQ "--validate respects relative core.hooksPath path" '
--to=nobody@example.com \
--smtp-server="$(pwd)/fake.sendmail" \
--validate \
- longline.patch 2>err &&
+ longline.patch 2>actual &&
test_path_is_file my-hooks.ran &&
- grep "rejected by sendemail-validate" err
+ cat >expect <<-\EOF &&
+ fatal: longline.patch: rejected by sendemail-validate hook
+ warning: no patches were sent
+ EOF
+ test_cmp expect actual
'
test_expect_success $PREREQ "--validate respects absolute core.hooksPath path" '
@@ -540,9 +548,13 @@ test_expect_success $PREREQ "--validate respects absolute core.hooksPath path" '
--to=nobody@example.com \
--smtp-server="$(pwd)/fake.sendmail" \
--validate \
- longline.patch 2>err &&
+ longline.patch 2>actual &&
test_path_is_file my-hooks.ran &&
- grep "rejected by sendemail-validate" err
+ cat >expect <<-\EOF &&
+ fatal: longline.patch: rejected by sendemail-validate hook
+ warning: no patches were sent
+ EOF
+ test_cmp expect actual
'
for enc in 7bit 8bit quoted-printable base64