]> diplodocus.org Git - nmh/blobdiff - test/mhstore/test-mhstore
Added debug printouts.
[nmh] / test / mhstore / test-mhstore
index fdf950ab072dbd71fd73e5fed2363f1bc618686c..0c94dc0bd4923c79945dbccd6beafe79a0066550 100755 (executable)
@@ -17,11 +17,18 @@ fi
 setup_test
 
 expected="$MH_TEST_DIR/test-mhstore$$.expected"
+expected2="$MH_TEST_DIR/test-mhstore$$.expected2"
 expected_err="$MH_TEST_DIR/test-mhmail$$.expected_err"
 actual="$MH_TEST_DIR/test-mhstore$$.actual"
 actual_err="$MH_TEST_DIR/test-mhmail$$.actual_err"
 
 cd "$MH_TEST_DIR"
+# ???? debug
+echo MH_TEST_DIR=$MH_TEST_DIR
+echo 'PWD   ='$PWD
+echo 'pwd   ='`pwd`
+echo 'pwd -L='`pwd -L`
+echo 'pwd -P='`pwd -P`
 
 # check with no options and no current message
 run_test 'mhstore' 'mhstore: no cur message'
@@ -117,6 +124,7 @@ This is the third text/plain part.
 ------- =_aaaaaaaaaa0
 Content-Type: text/plain; charset="iso-8859-1"; name="test4.txt"
 Content-Disposition: attachment; filename="test4.txt"
+Content-MD5: cMI1lB/LZ4jgVl3EbhdyWA==
 Content-Transfer-Encoding: base64
 
 VGhpcyBpcyB0aGUgZm91cnRoIHRleHQvcGxhaW4gcGFydC4NClRoaXMgdGVzdCBoYXMgbXVsdGlw
@@ -200,6 +208,15 @@ run_test 'mhstore last -part 2 -check' \
          'storing message 11 part 2 as file 11.2.txt'
 check "$expected" 11.2.txt 'keep first'
 
+# check with -check on base64 encoded part
+cat >"$expected2" <<'EOF'
+This is the fourth text/plain part.
+This test has multiple lines.
+EOF
+run_test 'mhstore last -part 4 -check' \
+         'storing message 11 part 4 as file 11.4.txt'
+check "$expected2" 11.4.txt
+
 # check -check with bad MD5 checksum
 sed 's/\(Content-MD5: \)kq+Hnc/\1BADBAD/' "$msgfile" >"$MH_TEST_DIR/$$.tmp"
 mv -f "$MH_TEST_DIR/$$.tmp" "$msgfile"
@@ -301,7 +318,7 @@ check "$expected" 7.txt.2 'keep first'
 
 # check -clobber never.  Its exit status is the number of files not overwritten.
 run_test 'mhstore -clobber never' \
-         "mhstore: will not overwrite `pwd`/7.txt with -clobber never"
+         "mhstore: will not overwrite $MH_TEST_DIR/Mail/7.txt with -clobber never"
 set +e
 mhstore -clobber never >/dev/null 2>&1
 run_test "echo $?" 1