X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/439ee6eac80d0e1f7efb882ccc44906b20730d20..e8dd4a8082d8a0e51c8d7ba61fbccb28ce3e96f3:/test/mhstore/test-mhstore diff --git a/test/mhstore/test-mhstore b/test/mhstore/test-mhstore index 06dc4745..716c2dd7 100755 --- a/test/mhstore/test-mhstore +++ b/test/mhstore/test-mhstore @@ -17,6 +17,7 @@ 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" @@ -117,6 +118,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 +202,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" @@ -212,7 +223,11 @@ check "$expected" 11.2.txt 'keep first' # check -nocheck, the default run_test 'mhstore last -part 2 -check -nocheck' \ 'storing message 11 part 2 as file 11.2.txt' -check "$expected" 11.2.txt +check "$expected" 11.2.txt 'keep first' + +# check -outfile - with -file +run_prog mhstore -noverbose -file `mhpath 11` -part 2 -outfile - >"$actual" 2>&1 +check "$expected" "$actual" # check reassembly of message/partial messages (RFC 1521, 7.3.2) msgfile=`mhpath new` @@ -297,7 +312,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