]> diplodocus.org Git - nmh/blobdiff - test/mhstore/test-mhstore
Fixed problem with m_getfld() with long headers reported by
[nmh] / test / mhstore / test-mhstore
index 3dde1ca45a18430b0ff097746d7b955cecc20216..d1f85427408d5dc6cc7779deae6c4f6ae60b665a 100755 (executable)
@@ -16,8 +16,8 @@ fi
 
 setup_test
 
-expected=$MH_TEST_DIR/$$.expected
-actual=$MH_TEST_DIR/$$.actual
+expected="$MH_TEST_DIR/test-mhstore$$.expected"
+actual="$MH_TEST_DIR/test-mhstore$$.actual"
 
 cd $MH_TEST_DIR
 
@@ -48,7 +48,17 @@ check $expected 5.txt 'keep first'
 # check -file -
 stored_contents=`mhstore -file - < $MH_TEST_DIR/Mail/inbox/5 2>&1 | \
   sed 's/.*as file //'`
-check $expected $stored_contents
+check $expected $stored_contents 'keep first'
+
+# check -outfile
+mhstore 5 -outfile "$actual" 2>&1 | grep -v '^storing' && \
+  echo unexpected output from test-mhstore check -outfile >&2
+check $expected "$actual" 'keep first'
+
+# check -outfile -
+echo 'storing message 5 to stdout' >>"$expected"
+mhstore 5 -outfile - >"$actual" 2>&1
+check $expected "$actual"
 
 # check message number greater than highest
 run_test 'mhstore 11' "mhstore: message 11 doesn't exist"
@@ -169,6 +179,14 @@ run_test 'mhstore last -part 4 -verbose -noverbose' \
   'storing message 11 part 4 as file 11.4.txt'
 check $expected 11.4.txt
 
+# check that -auto obeys Content-Disposition header
+cat > $expected <<EOF
+This is the first text/plain part, in a subpart.
+EOF
+run_test 'mhstore last -part 1.1 -auto' \
+  'storing message 11 part 1.1 as file test1.txt'
+check $expected test1.txt
+
 # check -check
 cat > $expected <<EOF
 This is the second text/plain part.