From a1aea7272e3dd98c389402791617a00b92783f86 Mon Sep 17 00:00:00 2001 From: Tomi Ollila Date: Thu, 16 May 2019 23:43:51 +0300 Subject: [PATCH] test-lib.sh: "tidied" emacs_deliver_message () Added initialization and checking of smtp_dummy_port like it was done with smtp_dummy_pid. Made those function-local variables. One 8 spaces to tab consistency conversion. And last, but definitely not least; while doing above noticed that there were quite a few double-quoted strings where $@ was in the middle of it -- replaced those with $* for robustness ("...$@..." expands params to separate words, "...$*..." params expands to single word). --- test/test-lib.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/test/test-lib.sh b/test/test-lib.sh index 7b49fc97..068e1029 100644 --- a/test/test-lib.sh +++ b/test/test-lib.sh @@ -320,14 +320,15 @@ emacs_deliver_message () shift 2 # before we can send a message, we have to prepare the FCC maildir mkdir -p "$MAIL_DIR"/sent/{cur,new,tmp} - # eval'ing smtp-dummy --background will set smtp_dummy_pid - smtp_dummy_pid= + # eval'ing smtp-dummy --background will set smtp_dummy_pid and -_port + local smtp_dummy_pid= smtp_dummy_port= eval `$TEST_DIRECTORY/smtp-dummy --background sent_message` test -n "$smtp_dummy_pid" || return 1 + test -n "$smtp_dummy_port" || return 1 test_emacs \ "(let ((message-send-mail-function 'message-smtpmail-send-it) - (mail-host-address \"example.com\") + (mail-host-address \"example.com\") (smtpmail-smtp-server \"localhost\") (smtpmail-smtp-service \"${smtp_dummy_port}\")) (notmuch-mua-mail) @@ -337,7 +338,7 @@ emacs_deliver_message () (insert \"${subject}\") (message-goto-body) (insert \"${body}\") - $@ + $* (notmuch-mua-send-and-exit))" # In case message was sent properly, client waits for confirmation @@ -381,7 +382,7 @@ emacs_fcc_message () (insert \"${subject}\") (message-goto-body) (insert \"${body}\") - $@ + $* (notmuch-mua-send-and-exit))" || return 1 notmuch new $nmn_args >/dev/null } @@ -999,7 +1000,7 @@ test_emacs () { rm -f OUTPUT touch OUTPUT - ${TEST_EMACSCLIENT} --socket-name="$EMACS_SERVER" --eval "(notmuch-test-progn $@)" + ${TEST_EMACSCLIENT} --socket-name="$EMACS_SERVER" --eval "(notmuch-test-progn $*)" } test_python() { -- 2.43.0