From: markus schnalke Date: Fri, 28 Nov 2014 11:21:39 +0000 (+0100) Subject: tests: Adjusted most of the tests to mmh. X-Git-Tag: mmh-0.2-RC1~87 X-Git-Url: http://git.marmaro.de/?a=commitdiff_plain;h=6e2f32e99cb31f65e86913e0706c92e257ab4169;p=mmh tests: Adjusted most of the tests to mmh. --- diff --git a/test/runtest b/test/runtest index edab162..8867661 100755 --- a/test/runtest +++ b/test/runtest @@ -47,6 +47,7 @@ do This is message number $i ! done +folder +inbox >/dev/null # now run the test set +e diff --git a/test/tests/bad-input/test-header b/test/tests/bad-input/test-header index 8d466ac..8a3251e 100644 --- a/test/tests/bad-input/test-header +++ b/test/tests/bad-input/test-header @@ -18,7 +18,7 @@ expected=$MH_TEST_DIR/$$.expected actual=$MH_TEST_DIR/$$.actual # Write message with bogus header field (missing blank line, really). -msgfile=$(mhpath new) +msgfile=$(mhpath b) msgnum=$(basename $msgfile) cat > $msgfile < $expected < $actual 2>&1 check -# check show (mhl) -cat > $expected < $actual 2>&1 -check - -# check mhshow +# check show cat > $expected < $actual 2>&1 +show $msgnum > $actual 2>&1 check exit $failed diff --git a/test/tests/folder/test-total b/test/tests/folder/test-total index ff29310..72d559e 100644 --- a/test/tests/folder/test-total +++ b/test/tests/folder/test-total @@ -6,6 +6,6 @@ ###################################################### output=`folder -total +inbox` -if test x"$output" != x'TOTAL = 10 messages in 1 folder.' ; then +if test x"$output" != x'TOTAL = 10 messages in 1 folder' ; then exit 1 fi diff --git a/test/tests/repl/test-if-str b/test/tests/repl/test-if-str index 7582a7d..7d6604b 100644 --- a/test/tests/repl/test-if-str +++ b/test/tests/repl/test-if-str @@ -19,7 +19,7 @@ X-NONUMBER: %(num 3)%(lit x)%<(num) yes%| no%>\n\ EOF expected=$MH_TEST_DIR/$$.expected -actual=$MH_TEST_DIR/Mail/draft +actual=$MH_TEST_DIR/Mail/drafts/1 cat > $expected < This is message number 1 EOF -repl -editor true -format -form $form -group -nocc me -nowhatnowproc 1 +repl -editor true -form $form -group -nocc me -whatnowproc true 1 diff -u $expected $actual diff --git a/test/tests/scan/test-scan b/test/tests/scan/test-scan index 780a69d..88082ee 100644 --- a/test/tests/scan/test-scan +++ b/test/tests/scan/test-scan @@ -9,16 +9,16 @@ expected=$MH_TEST_DIR/$$.expected actual=$MH_TEST_DIR/$$.actual cat > $expected <> - 2 09/29 Test2 Testing message 2<> - 3 09/29 Test3 Testing message 3<> - 4 09/29 Test4 Testing message 4<> - 5 09/29 Test5 Testing message 5<> - 6 09/29 Test6 Testing message 6<> - 7 09/29 Test7 Testing message 7<> - 8 09/29 Test8 Testing message 8<> - 9 09/29 Test9 Testing message 9<> - 10 09/29 Test10 Testing message 10<> + 1 2006-09-29 00:00 Test1 Testing message 1 + 2 2006-09-29 00:00 Test2 Testing message 2 + 3 2006-09-29 00:00 Test3 Testing message 3 + 4 2006-09-29 00:00 Test4 Testing message 4 + 5 2006-09-29 00:00 Test5 Testing message 5 + 6 2006-09-29 00:00 Test6 Testing message 6 + 7 2006-09-29 00:00 Test7 Testing message 7 + 8 2006-09-29 00:00 Test8 Testing message 8 + 9 2006-09-29 00:00 Test9 Testing message 9 + 10 2006-09-29 00:00 Test10 Testing message 10 EOF scan -width 80 +inbox > $actual diff --git a/test/tests/mhshow/test-cte-binary b/test/tests/show/test-cte-binary similarity index 85% rename from test/tests/mhshow/test-cte-binary rename to test/tests/show/test-cte-binary index 53a772a..07609b5 100644 --- a/test/tests/mhshow/test-cte-binary +++ b/test/tests/show/test-cte-binary @@ -9,7 +9,7 @@ expected=$MH_TEST_DIR/$$.expected actual=$MH_TEST_DIR/$$.actual # Write message with Content-Transfer-Encoding: binary text. -msgfile=$(mhpath new) +msgfile=$(mhpath b) msgnum=$(basename $msgfile) cat > $msgfile < $expected < $actual 2>&1 +show $msgnum > $actual 2>&1 diff -u $expected $actual diff --git a/test/tests/mhshow/test-qp b/test/tests/show/test-qp similarity index 93% rename from test/tests/mhshow/test-qp rename to test/tests/show/test-qp index 74d70ee..f702379 100644 --- a/test/tests/mhshow/test-qp +++ b/test/tests/show/test-qp @@ -11,7 +11,7 @@ expected=$MH_TEST_DIR/$$.expected actual=$MH_TEST_DIR/$$.actual # Write message with bogus quoted-printable data. -msgfile=$(mhpath new) +msgfile=$(mhpath b) msgnum=$(basename $msgfile) cat > $msgfile < $expected < $actual 2>&1 +show $msgnum > $actual 2>&1 diff -u $expected $actual diff --git a/test/tests/whatnow/test-attach-detach b/test/tests/whatnow/test-attach-detach index 1a36d8d..8932bc3 100644 --- a/test/tests/whatnow/test-attach-detach +++ b/test/tests/whatnow/test-attach-detach @@ -12,7 +12,8 @@ cd "$MH_TEST_DIR" rm -f "baz's boz" touch "baz's boz" # whatnow's attach stuff needs a draft to work on -cp "$MH_TEST_DIR/Mail/inbox/1" "$MH_TEST_DIR/Mail/draft" +# cp "$MH_TEST_DIR/Mail/inbox/1" "$MH_TEST_DIR/Mail/draft" +comp +inbox 1 -whatnow true expectederr=$MH_TEST_DIR/$$.expectederr actualerr=$MH_TEST_DIR/$$.actualerr @@ -28,10 +29,10 @@ EOF # whatnow's exit status is always 1 so that is not a failure set +e -echo "attach baz\\'s\\ boz" | whatnow -attach foo -noedit -prompt '' 2>> $actualerr >> $actual -echo "alist" | whatnow -attach foo -noedit -prompt '' 2>> $actualerr >> $actual -echo "detach baz\\'s\\ boz" | whatnow -attach foo -noedit -prompt '' 2>> $actualerr >> $actual -echo "alist" | whatnow -attach foo -noedit -prompt '' 2>> $actualerr >> $actual +echo "attach baz\\'s\\ boz" | whatnow -editor true -prompt '' 2>> $actualerr >> $actual +echo "alist" | whatnow -editor true -prompt '' 2>> $actualerr >> $actual +echo "detach baz\\'s\\ boz" | whatnow -editor true -prompt '' 2>> $actualerr >> $actual +echo "alist" | whatnow -editor true -prompt '' 2>> $actualerr >> $actual set -e diff -u $expectederr $actualerr diff --git a/test/tests/whatnow/test-cd b/test/tests/whatnow/test-cd index 3e0ddc4..44fecb6 100644 --- a/test/tests/whatnow/test-cd +++ b/test/tests/whatnow/test-cd @@ -26,9 +26,12 @@ EOF cat > $expectederr < "$actualerr" > "$actual" || true +printf "cd $MH_TEST_DIR/foo\\\\'s\\\\ bar\npwd\n" | whatnow -prompt '' 2> "$actualerr" > "$actual" || true diff -u $expectederr $actualerr diff -u $expected $actual diff --git a/test/tests/whatnow/test-ls b/test/tests/whatnow/test-ls index e0dc969..15d0824 100644 --- a/test/tests/whatnow/test-ls +++ b/test/tests/whatnow/test-ls @@ -26,8 +26,11 @@ EOF cat > $expectederr < "$actualerr" | sort > "$actual" +echo 'ls' | whatnow -prompt '' 2> "$actualerr" | sort > "$actual" diff -u $expectederr $actualerr diff -u $expected $actual