summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2018-02-13 13:39:07 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2018-02-13 13:39:07 -0800
commitf5536f1ce200e7e58642846dcf3d4f4122c3a604 (patch)
tree4fba74168b4ea05e9eae310e0d308a93364c4f55
parentMerge branch 'gs/retire-mru' (diff)
parentt9001: use existing helper in send-email test (diff)
downloadtgif-f5536f1ce200e7e58642846dcf3d4f4122c3a604.tar.xz
Merge branch 'cl/t9001-cleanup'
Test clean-up. * cl/t9001-cleanup: t9001: use existing helper in send-email test
-rwxr-xr-xt/t9001-send-email.sh17
1 files changed, 7 insertions, 10 deletions
diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh
index a06e5d7ba5..19601fb546 100755
--- a/t/t9001-send-email.sh
+++ b/t/t9001-send-email.sh
@@ -6,6 +6,12 @@ test_description='git send-email'
# May be altered later in the test
PREREQ="PERL"
+replace_variable_fields () {
+ sed -e "s/^\(Date:\).*/\1 DATE-STRING/" \
+ -e "s/^\(Message-Id:\).*/\1 MESSAGE-ID-STRING/" \
+ -e "s/^\(X-Mailer:\).*/\1 X-MAILER-STRING/"
+}
+
test_expect_success $PREREQ 'prepare reference tree' '
echo "1A quick brown fox jumps over the" >file &&
echo "lazy dog" >>file &&
@@ -315,10 +321,7 @@ test_expect_success $PREREQ 'Show all headers' '
--bcc=bcc@example.com \
--in-reply-to="<unique-message-id@example.com>" \
--smtp-server relay.example.com \
- $patches |
- sed -e "s/^\(Date:\).*/\1 DATE-STRING/" \
- -e "s/^\(Message-Id:\).*/\1 MESSAGE-ID-STRING/" \
- -e "s/^\(X-Mailer:\).*/\1 X-MAILER-STRING/" \
+ $patches | replace_variable_fields \
>actual-show-all-headers &&
test_cmp expected-show-all-headers actual-show-all-headers
'
@@ -573,12 +576,6 @@ Result: OK
EOF
"
-replace_variable_fields () {
- sed -e "s/^\(Date:\).*/\1 DATE-STRING/" \
- -e "s/^\(Message-Id:\).*/\1 MESSAGE-ID-STRING/" \
- -e "s/^\(X-Mailer:\).*/\1 X-MAILER-STRING/"
-}
-
test_suppression () {
git send-email \
--dry-run \