]> diplodocus.org Git - nmh/blobdiff - test/mhshow/test-subpart
test-subpart: add mhlist and mhshow tests for -type/-part/-prefer
[nmh] / test / mhshow / test-subpart
index 9739c48df25bd8cd54f89b5bcdb77f03c62b076b..161dceab7ead9a3d319da2f15b0a1703856d9956 100755 (executable)
@@ -59,4 +59,114 @@ EOF
 run_prog mhshow -part 1.1 -form mhl.null $msgnum > $actual 2>&1
 check "$expected" "$actual"
 
+cat > $msgfile <<EOF
+To: example@example.org
+From: someone <someone@example.com>
+Subject: mhshow -part/-type/prefer test
+Date: Thu, 29 Jan 2015 18:12:21 +0000 (GMT)
+Content-Type: multipart/mixed; boundary="BoundaryMixed"
+
+--BoundaryMixed
+Content-type: multipart/alternative;
+ boundary="BoundaryAlternative1"
+
+--BoundaryAlternative1
+Content-type: text/plain; charset=ISO-8859-1; format=flowed
+Content-transfer-encoding: 8bit
+
+This is the body text/plain part.
+--BoundaryAlternative1
+Content-type: multipart/related;
+ boundary="BoundaryAlternative2"; type="text/html"
+
+--BoundaryAlternative2
+Content-type: text/html; CHARSET=US-ASCII
+Content-transfer-encoding: quoted-printable
+
+<html><body><div><span style=3D"line-height: 1.5;">
+This is the text/html body part.
+</span></div></body></html>
+
+--BoundaryAlternative2--
+
+--BoundaryAlternative1--
+
+--BoundaryMixed
+Content-Type: text/plain; charset="us-ascii"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Content-Disposition: inline
+
+_______________________________________________
+This is the final text/plain signature part.
+
+--BoundaryMixed--
+EOF
+
+# Write the expected output.
+cat > $expected <<EOF
+[ part 1.1.1 - text/html -   111B  ]
+This is the text/html body part.
+EOF
+
+# check it
+run_prog mhshow -part 1.1.1 -form mhl.null $msgnum > $actual 2>&1
+check "$expected" "$actual"
+
+# Write the expected output.
+cat > $expected <<EOF
+[ part 1.2 - text/plain -   33B  ]
+This is the body text/plain part.
+EOF
+
+# check it
+run_prog mhshow -part 1.2 -form mhl.null $msgnum > $actual 2>&1
+check "$expected" "$actual"
+
+# Write the expected output.
+cat > $expected <<EOF
+[ part 1.1 - text/plain -   33B  ]
+This is the body text/plain part.
+EOF
+
+# check it
+run_prog mhshow -prefer text/plain -part 1 -form mhl.null $msgnum > $actual 2>&1
+check "$expected" "$actual"
+
+# Write the expected output.
+cat > $expected <<EOF
+[ part 2 - text/plain -   93B  ]
+_______________________________________________
+This is the final text/plain signature part.
+EOF
+
+# check it
+run_prog mhshow -part 2 -form mhl.null $msgnum > $actual 2>&1
+check "$expected" "$actual"
+
+# Write the expected output.
+cat > $expected <<EOF
+[ part 1.2 - text/plain -   33B  ]
+This is the body text/plain part.
+[ part 2 - text/plain -   93B  ]
+_______________________________________________
+This is the final text/plain signature part.
+EOF
+
+# check it
+run_prog mhshow -type text/plain -form mhl.null $msgnum > $actual 2>&1
+check "$expected" "$actual"
+
+# Write the expected output.
+cat > $expected <<EOF
+[ part 1.1 - text/plain -   33B  ]
+This is the body text/plain part.
+[ part 2 - text/plain -   93B  ]
+_______________________________________________
+This is the final text/plain signature part.
+EOF
+
+run_prog mhshow -prefer text/plain -form mhl.null $msgnum > $actual 2>&1
+check "$expected" "$actual"
+
 exit $failed