# Write the expected output.
cat > $expected <<EOF
+[ Message inbox:11 ]
[ part 1.1 - text/plain - 29B ]
This is the text/plain part.
EOF
# check it
run_prog mhshow -part 1.1 -form mhl.null $msgnum > $actual 2>&1
-check "$expected" "$actual"
+check "$expected" "$actual" : part 1.1
+
+
+# tests of -part/-type/-prefer
cat > $msgfile <<EOF
To: example@example.org
From: someone <someone@example.com>
-Subject: mhshow -part/-type/prefer test
+Subject: mhshow -part/-type/-prefer test
Date: Thu, 29 Jan 2015 18:12:21 +0000 (GMT)
Content-Type: multipart/mixed; boundary="BoundaryMixed"
boundary="BoundaryAlternative1"
--BoundaryAlternative1
-Content-type: text/plain; charset=ISO-8859-1; format=flowed
+Content-type: text/plain; charset=US-ASCII; format=flowed
Content-transfer-encoding: 8bit
This is the body text/plain part.
# Write the expected output.
cat > $expected <<EOF
+[ Message inbox:11 ]
[ 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"
+# The sed command removes blank lines and leading space that lynx inserts.
+run_prog mhshow -part 1.1.1 -form mhl.null $msgnum |
+ sed '/^$/D; s/^ *//;' > $actual 2>&1
+check "$expected" "$actual" : part 1.1.1
# Write the expected output.
cat > $expected <<EOF
+[ Message inbox:11 ]
[ 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"
+check "$expected" "$actual" : part 1.2
# Write the expected output.
cat > $expected <<EOF
+[ Message inbox:11 ]
[ 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"
+check "$expected" "$actual" : part conflicting text/plain, part 1 switches
# Write the expected output.
cat > $expected <<EOF
+[ Message inbox:11 ]
[ part 2 - text/plain - 93B ]
_______________________________________________
This is the final text/plain signature part.
# check it
run_prog mhshow -part 2 -form mhl.null $msgnum > $actual 2>&1
-check "$expected" "$actual"
+check "$expected" "$actual" : part 2
# Write the expected output.
cat > $expected <<EOF
+[ Message inbox:11 ]
[ part 1.2 - text/plain - 33B ]
This is the body text/plain part.
[ part 2 - text/plain - 93B ]
# check it
run_prog mhshow -type text/plain -form mhl.null $msgnum > $actual 2>&1
-check "$expected" "$actual"
+check "$expected" "$actual" : type text/plain
# Write the expected output.
cat > $expected <<EOF
+[ Message inbox:11 ]
[ part 1.1 - text/plain - 33B ]
This is the body text/plain part.
[ part 2 - text/plain - 93B ]
EOF
run_prog mhshow -prefer text/plain -form mhl.null $msgnum > $actual 2>&1
-check "$expected" "$actual"
+check "$expected" "$actual" : prefer text/plain
exit $failed