X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/b3c37ca5f7bd503f07787e1ac87c1af2ab37f5ba..a69b69121b49e6de84d0e8bf0e39ba3a96b67188:/test/repl/test-repl diff --git a/test/repl/test-repl b/test/repl/test-repl index d9c39a13..7de80246 100755 --- a/test/repl/test-repl +++ b/test/repl/test-repl @@ -19,6 +19,8 @@ fi setup_test +check_exit '-eq 1' repl - # gcov + expected=$MH_TEST_DIR/$$.expected actual=$MH_TEST_DIR/Mail/draft @@ -29,13 +31,13 @@ Usage: repl: [+folder] [msg] [switches] switches are: -[no]group -[no]annotate - -cc all|to|cc|me - -nocc type + -[no]cc all|to|cc|me -draftfolder +folder -draftmessage msg -nodraftfolder -editor editor -noedit + -convertargs type argstring -fcc folder -filter filterfile -form formfile @@ -55,14 +57,15 @@ Usage: repl: [+folder] [msg] [switches] -nofmtproc EOF -repl -help >$actual 2>&1 -check $expected $actual +#### Skip nmh intro text. +run_prog repl -help | sed '/^$/,$d' >"$actual" 2>&1 +check "$expected" "$actual" # check -version case `repl -v` in repl\ --*) ;; - * ) printf "$0: repl -v generated unexpected output\n" >&2 - failed=`expr ${failed:-0} + 1`;; + * ) printf '%s: repl -v generated unexpected output\n' "$0" >&2 + failed=`expr ${failed:-0} + 1`;; esac # check unknown switch @@ -72,7 +75,7 @@ run_test "repl -nonexistent" 'repl: -nonexistent unknown' run_test "repl" 'repl: no cur message' -printf "Local-Mailbox: mymailbox@localhost%s\n" >> $MH +printf 'Local-Mailbox: mymailbox@localhost\n' >> "$MH" # check -cc me cat >$expected < cc: mymailbox@localhost Fcc: +outbox Subject: Re: Testing message 1 +In-reply-to: 1@test.nmh +References: 1@test.nmh Comments: In-reply-to Test1 message dated "Fri, 29 Sep 2006 00:00:00." -------- EOF -repl -cc me -editor true -nowhatnowproc 1 +run_prog repl -cc me -editor true -nowhatnowproc 1 check $expected $actual # check -nocc me @@ -96,17 +101,19 @@ To: Test1 cc: Fcc: +outbox Subject: Re: Testing message 1 +In-reply-to: 1@test.nmh +References: 1@test.nmh Comments: In-reply-to Test1 message dated "Fri, 29 Sep 2006 00:00:00." -------- EOF -repl -cc me -nocc me -editor true -nowhatnowproc 1 +run_prog repl -cc me -nocc me -editor true -nowhatnowproc 1 check $expected $actual # check -cc me with Local- and Alternate-Mailbox addtions, Bug #36635: # -nocc me doesn't account for Alternate-Mailboxes. -printf "Alternate-Mailboxes: user@example.com\n" >> $MH +printf 'Alternate-Mailboxes: user@example.com\n' >> "$MH" cat >$expected < cc: mymailbox@localhost Fcc: +outbox Subject: Re: Testing message 1 +In-reply-to: 1@test.nmh +References: 1@test.nmh Comments: In-reply-to Test1 message dated "Fri, 29 Sep 2006 00:00:00." -------- EOF -repl -cc me -editor true -nowhatnowproc 1 +run_prog repl -cc me -editor true -nowhatnowproc 1 check $expected $actual @@ -131,12 +140,45 @@ To: Test1 cc: Fcc: +outbox Subject: Re: Testing message 1 +In-reply-to: 1@test.nmh +References: 1@test.nmh Comments: In-reply-to Test1 message dated "Fri, 29 Sep 2006 00:00:00." -------- EOF -repl -cc me -nocc me -editor true -nowhatnowproc 1 +run_prog repl -cc me -nocc me -editor true -nowhatnowproc 1 +check $expected $actual + + +# check quoting of local part of invalid address, Bug #26780 +cat >`mhpath new` < +To: before_auser@example.com, A. User , + after_user@example.com +Date: Fri, 29 Sep 2006 00:00:11 +Message-Id: 11@test.nmh +Subject: Testing message 11 + +This is message number 11 + +EOF + +cat >$expected < +cc: before_auser@example.com, "A. User" , + after_user@example.com +Fcc: +outbox +Subject: Re: Testing message 11 +In-reply-to: 11@test.nmh +References: 11@test.nmh +Comments: In-reply-to Test11 + message dated "Fri, 29 Sep 2006 00:00:11." +-------- +EOF + +run_prog repl -cc to -editor true -nowhatnowproc 11 check $expected $actual