X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/012d05c2b62332eb400d66b806e48216d39358c6..a1f79aa7a083e74292c0f0654010179082da7a94:/test/repl/test-repl diff --git a/test/repl/test-repl b/test/repl/test-repl index 20bb96d7..c406b009 100755 --- a/test/repl/test-repl +++ b/test/repl/test-repl @@ -19,11 +19,14 @@ fi setup_test +check_exit '-eq 1' repl - + expected=$MH_TEST_DIR/$$.expected actual=$MH_TEST_DIR/Mail/draft # check -help +start_test -help cat >$expected <$actual 2>&1 -check $expected $actual +#### Skip nmh intro text. +run_prog repl -help | sed '/^$/,$d' >"$actual" 2>&1 +check "$expected" "$actual" # check -version +start_test -version case `repl -v` in repl\ --*) ;; * ) printf '%s: repl -v generated unexpected output\n' "$0" >&2 @@ -66,15 +71,18 @@ case `repl -v` in esac # check unknown switch +start_test 'unknown switch' run_test "repl -nonexistent" 'repl: -nonexistent unknown' # check with no switches +start_test 'with no switches' run_test "repl" 'repl: no cur message' printf 'Local-Mailbox: mymailbox@localhost\n' >> "$MH" # check -cc me +start_test '-cc me' cat >$expected < @@ -92,6 +100,7 @@ run_prog repl -cc me -editor true -nowhatnowproc 1 check $expected $actual # check -nocc me +start_test '-nocc me' cat >$expected < @@ -108,7 +117,8 @@ EOF 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: +# check -cc me with Local- and Alternate-Mailbox addtions, Bug #36635 +start_test '-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" @@ -129,7 +139,8 @@ run_prog repl -cc me -editor true -nowhatnowproc 1 check $expected $actual -# check -nocc me with Local- and Alternate-Mailbox addtions, Bug #36635: +# check -nocc me with Local- and Alternate-Mailbox addtions, Bug #36635 +start_test '-nocc me with Local- and Alternate-Mailbox addtions, Bug #36635' # -nocc me doesn't account for Alternate-Mailboxes. cat >$expected <`mhpath new` < To: before_auser@example.com, A. User , @@ -179,4 +191,51 @@ run_prog repl -cc to -editor true -nowhatnowproc 11 check $expected $actual +# check that Fcc: header isn't propagated +start_test "Fcc: header isn't propagated" +form="${MH_TEST_DIR}/$$.components" +cat > $form <<'EOF' +From: sender@example.com +%<{from}%(void(width))%(putaddr To: )%> +Fcc:%<{fcc} %{fcc}%> +Subject: %<{subject}Re: %(void{subject})%(trim)%(putstr)%> +-------- +EOF +cat > $expected < `mhpath new`< $expected <