On some platforms, need to be out of $SPDIR in order to remove it.
[mmh] / test / mhstore / test-mhstore
index 52b92f7..cbb1859 100755 (executable)
@@ -80,7 +80,7 @@ Content-Type: multipart/related;
     boundary="subpart__1.1"
 
 --subpart__1.1
-Content-Type: text/plain; charset="us-ascii"
+Content-Type: text/plain; charset="iso-8859-1"
 Content-Disposition: attachment; filename="test1.txt"
 
 This is the first text/plain part, in a subpart.
@@ -88,7 +88,7 @@ This is the first text/plain part, in a subpart.
 --subpart__1.1--
 
 ------- =_aaaaaaaaaa0
-Content-Type: text/plain; charset="us-ascii"
+Content-Type: text/plain; charset="iso-8859-1"
 Content-Disposition: attachment; filename="test2.txt"
 Content-MD5: kq+Hnc2SD/eKwAnkFBDuEA==
 Content-Transfer-Encoding: quoted-printable
@@ -96,13 +96,13 @@ Content-Transfer-Encoding: quoted-printable
 This is the second text/plain part.
 
 ------- =_aaaaaaaaaa0
-Content-Type: text/plain; charset="us-ascii"
+Content-Type: text/plain; charset="iso-8859-1"
 Content-Disposition: attachment; filename="test3.txt"
 
 This is the third text/plain part.
 
 ------- =_aaaaaaaaaa0
-Content-Type: text/plain; charset="us-ascii"; name="test4.txt"
+Content-Type: text/plain; charset="iso-8859-1"; name="test4.txt"
 Content-Disposition: attachment; filename="test4.txt"
 Content-Transfer-Encoding: base64
 
@@ -200,7 +200,7 @@ Subject: mhlist test
 MIME-Version: 1.0
 Content-Type: message/partial; id="test-mhstore message/partial test"; number=1
 
-Content-Type: text/plain; charset="us-ascii"
+Content-Type: text/plain; charset="iso-8859-1"
 
 This is part one of three.
 EOF
@@ -239,5 +239,37 @@ EOF
 run_test 'mhstore last' 'storing message 15 as file 15.txt'
 check $expected 15.txt
 
+# check with relative nmh-storage profile component
+storagedir=storagedir
+dir="$MH_TEST_DIR/Mail/inbox/$storagedir"
+mkdir "$dir"
+echo "nmh-storage: $storagedir" >> $MH
+cat > $expected <<EOF
+This is the fourth text/plain part.
+EOF
+run_test 'mhstore 11 -part 4' \
+"storing message 11 part 4 as file $storagedir/11.4.txt"
+check $expected "$dir/11.4.txt" 'keep first'
+
+# check with relative nmh-storage profile component and -auto
+run_test 'mhstore 11 -part 4 -auto' \
+"storing message 11 part 4 as file $storagedir/test4.txt"
+check $expected "$dir/test4.txt" 'keep first'
+
+# check with absolute nmh-storage profile component
+absstoragedir="$MH_TEST_DIR/$storagedir"
+mkdir "$absstoragedir"
+sed "s%\(nmh-storage: \)storagedir%\1$absstoragedir%" $MH > $MH.new
+mv -f $MH.new $MH
+run_test 'mhstore 11 -part 4' \
+"storing message 11 part 4 as file $storagedir/11.4.txt"
+check $expected "$absstoragedir/11.4.txt" 'keep first'
+
+# check with absolute nmh-storage profile component and -auto
+run_test 'mhstore 11 -part 4 -auto' \
+"storing message 11 part 4 as file $storagedir/test4.txt"
+check $expected "$absstoragedir/test4.txt"
+rmdir "$absstoragedir"
+
 
 exit $failed