Fix out-of-bounds error when incorporating email from stdin
[mmh] / test / tests / whatnow / test-attach-detach
index 1a36d8d..82b25c6 100644 (file)
@@ -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
@@ -23,16 +24,17 @@ rm -f $expected $expectederr $actual $actualerr
 touch $expected $expectederr $actual $actualerr
 
 cat > $expected <<EOF
-baz's boz
+1      /XXX/baz's boz
 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 1" | whatnow -editor true -prompt '' 2>> $actualerr >> $actual
+echo "alist" | whatnow -editor true -prompt '' 2>> $actualerr >> $actual
 set -e
 
 diff -u $expectederr $actualerr
-diff -u $expected $actual
+<$actual sed 's,/.*/,/XXX/,' >$actual.clean
+diff -u $expected $actual.clean