X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/587e977a97865f091131355f6dd250ece99f7adb..397deef44d1f8d92b781e7d9af6f0f256eccbe73:/test/whatnow/test-attach-detach diff --git a/test/whatnow/test-attach-detach b/test/whatnow/test-attach-detach index 9f308aa3..3181f21b 100755 --- a/test/whatnow/test-attach-detach +++ b/test/whatnow/test-attach-detach @@ -17,6 +17,9 @@ fi setup_test +# Set TERM to get consistent output. +TERM=dumb; export TERM + cd "$MH_TEST_DIR" testname="baz's boz" testname_quoted="baz\'s\ boz" @@ -38,21 +41,23 @@ touch $expected $expectederr $actual $actualerr # set +e -whatnowtest=`echo cd | TERM=dumb whatnow -prompt ''` +whatnowtest=`echo cd | whatnow -prompt ''` set -e case ${whatnowtest} in - cd) cat > "$expected" <"$expected" < "$expected" <"$expected" <> $actualerr >> $actual -echo "alist" | TERM=dumb whatnow -attach foo -noedit -prompt '' \ - 2>> $actualerr >> $actual + run_prog whatnow -attach foo -noedit -prompt '' 2>>$actualerr >>$actual +echo "alist" | \ + run_prog whatnow -attach foo -noedit -prompt '' 2>>$actualerr >>$actual echo "detach $testname_quoted" | \ - TERM=dumb whatnow -attach foo -noedit -prompt '' 2>> $actualerr >> $actual -echo "alist" | TERM=dumb whatnow -attach foo -noedit -prompt '' \ - 2>> $actualerr >> $actual + run_prog whatnow -attach foo -noedit -prompt '' 2>>$actualerr >>$actual +echo "alist" | \ + run_prog whatnow -attach foo -noedit -prompt '' 2>>$actualerr >>$actual set -e check "$expectederr" "$actualerr" check "$expected" "$actual" +if [ "$readline" = 0 ]; then +cat >"$expected" < [context]{attachment} ${MH_TEST_DIR}/Mail/context +EOF +else +cat >"$expected" < [context]{attachment} ${MH_TEST_DIR}/Mail/context +quit -delete +EOF +fi + +printf '%s\n' \ + 'at' \ + 'at -v' \ + 'at -v Mail/context' \ + 'quit -delete' | whatnow -prompt '' 2>&1 | \ + sed -e 's/; charset=us-ascii//' >"$actual" + +check "$expected" "$actual" + test ${failed:-0} -eq 0 && rm "$testname" exit $failed