From: Paul Fox Date: Sun, 8 Feb 2015 20:13:31 +0000 (-0500) Subject: update tests for new message separator header from mhshow X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/7e288a9d7941d2d9df94f9ee70e47061f0f36304?ds=inline;hp=-c update tests for new message separator header from mhshow also added test names to tests, in any file i touched --- 7e288a9d7941d2d9df94f9ee70e47061f0f36304 diff --git a/test/bad-input/test-header b/test/bad-input/test-header index 1716ff1f..eeacc831 100755 --- a/test/bad-input/test-header +++ b/test/bad-input/test-header @@ -38,7 +38,7 @@ cat >"$expected" < "$actual" 2>&1 -check "$expected" "$actual" +check "$expected" "$actual" : scan with bogus header field # check show (mhl) cat >"$expected" < "$actual" 2>&1 -check "$expected" "$actual" +check "$expected" "$actual" : "show (mhl) with bogus header field" # check mhshow cat >"$expected" < "$actual" 2>&1 -check "$expected" "$actual" +check "$expected" "$actual" : mhshow with bogus header field # check m_getfld() handling of empty header field msgfile="$MH_TEST_DIR/Mail/inbox/12" @@ -86,8 +87,8 @@ scan: eof encountered in field "Received" EOF run_prog scan -width 13 last >"$actual" 2>"$actual_err" -check "$expected" "$actual" -check "$expected_err" "$actual_err" +check "$expected" "$actual" : m_getfld, empty header output +check "$expected_err" "$actual_err" : m_getfld, empty header error # check m_getfld() handling of excessively long header field name msgfile="$MH_TEST_DIR/Mail/inbox/13" @@ -100,7 +101,7 @@ cat >"$expected" <"$actual" 2>"$actual_err" -check "$expected" "$actual" +check "$expected" "$actual" : m_getfld with excessively long header field name # Cygwin has a BUFSIZ of 1024 so the error message gets truncated. # Deal with that by grepping to verify that scan showed the proper error. verify_string_in_file() { @@ -135,8 +136,8 @@ scan: eol encountered in field "If a header field name has at least 512 characte EOF run_prog scan -width 13 last >"$actual" 2>"$actual_err" -check "$expected" "$actual" -check "$expected_err" "$actual_err" +check "$expected" "$actual" : m_getfld with long header, no colon output +check "$expected_err" "$actual_err" : m_getfld with long header, no colon error exit $failed diff --git a/test/mhshow/test-charset b/test/mhshow/test-charset index e0a0b6e8..6c3c763a 100755 --- a/test/mhshow/test-charset +++ b/test/mhshow/test-charset @@ -43,6 +43,7 @@ Date: Sun, 18 Dec 2005 00:52:39 +0100 EOF cat > $expected < $actual 2>&1 -check "$expected" "$actual" +check "$expected" "$actual" : bogus quoted-printable data exit $failed diff --git a/test/mhshow/test-cte-binary b/test/mhshow/test-cte-binary index fdf1ca78..f872e3b0 100755 --- a/test/mhshow/test-cte-binary +++ b/test/mhshow/test-cte-binary @@ -35,6 +35,7 @@ EOF # check it cat > $expected < $actual 2>&1 -check "$expected" "$actual" +check "$expected" "$actual" : C-T-E binary text exit $failed diff --git a/test/mhshow/test-msg-buffer-boundaries b/test/mhshow/test-msg-buffer-boundaries index 47005cc9..ca1e7cd6 100755 --- a/test/mhshow/test-msg-buffer-boundaries +++ b/test/mhshow/test-msg-buffer-boundaries @@ -153,12 +153,13 @@ EOF # Write the expected output. cat >"$expected" <"$actual" 2>&1 -check "$expected" "$actual" +check "$expected" "$actual" : check number 1 # check a boundary condition in m_getfld(): its internal message # buffer holds exactly up to the end of a header field name in a @@ -293,12 +294,13 @@ EOF # Write the expected output. cat >"$expected" <"$actual" 2>&1 -check "$expected" "$actual" +check "$expected" "$actual" : check number 2 # check a boundary condition in m_getfld(): its internal message # buffer holds exactly up to the end of a message part boundary @@ -434,12 +436,13 @@ EOF # Write the expected output. cat >"$expected" <"$actual" 2>&1 -check "$expected" "$actual" +check "$expected" "$actual" : check number 3 exit $failed diff --git a/test/mhshow/test-qp b/test/mhshow/test-qp index dae70a5a..1b78c8ea 100755 --- a/test/mhshow/test-qp +++ b/test/mhshow/test-qp @@ -47,6 +47,7 @@ EOF # check it cat > $expected < $actual 2>&1 -check "$expected" "$actual" +check "$expected" "$actual" : bogus quoted-printable data exit $failed diff --git a/test/mhshow/test-subpart b/test/mhshow/test-subpart index 161dceab..28bca944 100755 --- a/test/mhshow/test-subpart +++ b/test/mhshow/test-subpart @@ -51,18 +51,22 @@ EOF # Write the expected output. cat > $expected < $actual 2>&1 -check "$expected" "$actual" +check "$expected" "$actual" : part 1.1 + + +# tests of -part/-type/-prefer cat > $msgfile < -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" @@ -105,36 +109,40 @@ EOF # Write the expected output. cat > $expected < $actual 2>&1 -check "$expected" "$actual" +check "$expected" "$actual" : part 1.1.1 # Write the expected output. cat > $expected < $actual 2>&1 -check "$expected" "$actual" +check "$expected" "$actual" : part 1.2 # Write the expected output. cat > $expected < $actual 2>&1 -check "$expected" "$actual" +check "$expected" "$actual" : part conflicting text/plain, part 1 switches # Write the expected output. cat > $expected < $actual 2>&1 -check "$expected" "$actual" +check "$expected" "$actual" : part 2 # Write the expected output. cat > $expected < $actual 2>&1 -check "$expected" "$actual" +check "$expected" "$actual" : type text/plain # Write the expected output. cat > $expected < $actual 2>&1 -check "$expected" "$actual" +check "$expected" "$actual" : prefer text/plain exit $failed diff --git a/test/mhshow/test-textcharset b/test/mhshow/test-textcharset index d4d7ef07..f8d854fc 100755 --- a/test/mhshow/test-textcharset +++ b/test/mhshow/test-textcharset @@ -28,6 +28,7 @@ actual="$MH_TEST_DIR"/$$.actual # check charset conversion msgfile=`mhpath new` +msgnum=`basename $msgfile` cat >"$msgfile" <<'EOF' From: foo@example.edu To: bar@example.edu @@ -40,7 +41,8 @@ Date: Sun, 18 Dec 2005 00:52:39 +0100 4 =F7 2 =3D 2 EOF -cat >"$expected" <<'EOF' +cat >"$expected" <"$actual" 2>&1 -check "$expected" "$actual" +check "$expected" "$actual" : check charset conversion cat >>"$MH" <<'EOF' mhshow-show-text/plain: echo %{charset} @@ -62,6 +64,7 @@ EOF # check expansion of %{charset} by itself msgfile=`mhpath new` +msgnum=`basename $msgfile` cat >"$msgfile" <<'EOF' From: foo@example.edu To: bar@example.edu @@ -74,7 +77,8 @@ Date: Sun, 18 Dec 2005 00:52:39 +0100 4 =F7 2 =3D 2 EOF -cat >"$expected" <<'EOF' +cat >"$expected" <"$actual" 2>&1 -check "$expected" "$actual" +check "$expected" "$actual" : check %{charset} by itself # check expansion of empty %{charset} by itself msgfile=`mhpath new` +omsgnum=$msgnum +msgnum=`basename $msgfile` cat >"$msgfile" <<'EOF' From: foo@example.edu To: bar@example.edu @@ -103,7 +109,8 @@ Date: Sun, 18 Dec 2005 00:52:39 +0100 4 =F7 2 =3D 2 EOF -cat >"$expected" <<'EOF' +cat >"$expected" <"$actual" 2>&1 -check "$expected" "$actual" +check "$expected" "$actual" : check empty %{charset} by itself grep -v 'mhshow-show-text/plain:' "$MH" >"$MH.new" @@ -125,7 +132,8 @@ mhshow-show-text/plain: charset=%{charset}; echo ${charset:+-I $charset} EOF # check expansion of embedded %{charset} with no text following -cat >"$expected" <<'EOF' +cat >"$expected" <"$actual" 2>&1 -check "$expected" "$actual" +run_prog mhshow prev >"$actual" 2>&1 # NB: "mhshow prev" !!! +check "$expected" "$actual" : check embedded %{charset} with no text # check expansion of empty embedded %{charset} with no text following -cat >"$expected" <<'EOF' +cat >"$expected" <"$actual" 2>&1 -check "$expected" "$actual" +check "$expected" "$actual" : check empty embedded %{charset} with no text following sed -e 's%\(mhshow-show-text/plain:.*\)%\1 file%' "$MH" >"$MH.new" mv -f "$MH.new" "$MH" # check expansion of embedded %{charset} with text following -cat >"$expected" <<'EOF' +cat >"$expected" <"$actual" 2>&1 -check "$expected" "$actual" +run_prog mhshow prev >"$actual" 2>&1 # NB: "mhshow prev" !!! +check "$expected" "$actual" : check embedded %{charset} with text following # check expansion of empty embedded %{charset} with text following -cat >"$expected" <<'EOF' +cat >"$expected" <"$actual" 2>&1 -check "$expected" "$actual" +check "$expected" "$actual" : check empty embedded %{charset} with text following sed -e 's/charset/method/g' "$MH" >"$MH.new" @@ -196,6 +207,7 @@ mv -f "$MH.new" "$MH" # check parameter value quoting msgfile=`mhpath new` +msgnum=`basename $msgfile` cat >"$msgfile" <<'EOF' From: foo@example.edu To: bar@example.edu @@ -208,7 +220,10 @@ Date: Sun, 18 Dec 2005 00:52:39 +0100 4 =F7 2 =3D 2 EOF -cat >"$expected" <<'EOF' +cat >"$expected" <>"$expected" <<'EOF' Date: Sun, 18 Dec 2005 00:52:39 +0100 To: bar@example.edu From: foo@example.edu @@ -220,7 +235,7 @@ MIME-Version: 1.0 EOF run_prog mhshow last >"$actual" 2>&1 -check "$expected" "$actual" +check "$expected" "$actual" : check parameter value quoting sed -e 's/method/unknown/g' "$MH" >"$MH.new" @@ -228,6 +243,7 @@ mv -f "$MH.new" "$MH" # check that unknown parameter is not expanded msgfile=`mhpath new` +msgnum=`basename $msgfile` cat >"$msgfile" <<'EOF' From: foo@example.edu To: bar@example.edu @@ -240,7 +256,8 @@ Date: Sun, 18 Dec 2005 00:52:39 +0100 4 =F7 2 =3D 2 EOF -cat >"$expected" <<'EOF' +cat >"$expected" <"$actual" 2>&1 -check "$expected" "$actual" +check "$expected" "$actual" : check unknown parameter is not expanded grep -v '^mhshow-show-text/plain: ' "$MH" >>"$MH.new" @@ -263,6 +280,7 @@ EOF # check parameter value quoting with text following msgfile=`mhpath new` +msgnum=`basename $msgfile` cat >"$msgfile" <<'EOF' From: foo@example.edu To: bar@example.edu @@ -274,7 +292,8 @@ Date: Sun, 18 Dec 2005 00:52:39 +0100 This is a test. EOF -cat >"$expected" <<'EOF' +cat >"$expected" <"$actual" 2>&1 -check "$expected" "$actual" +check "$expected" "$actual" : parameter value quoting with text following # # test a large file that needs to be converted to UTF-8 @@ -294,6 +313,7 @@ check "$expected" "$actual" grep -v '^mhshow-show-text/plain: ' "$MH" >>"$MH.new" mv -f "$MH.new" "$MH" msgfile=`mhpath new` +msgnum=`basename $msgfile` cat >"$msgfile" <<'EOF' From: foo@example.edu To: bar@example.edu @@ -728,7 +748,8 @@ one of the glass buildings. =93How strange!=94 she exclaimed, drawing a long breath. EOF -cat >"$expected" <<'EOF' +cat >"$expected" <"$actual" 2>&1 -check "$expected" "$actual" +check "$expected" "$actual" : large file conversion to UTF-8 exit $failed diff --git a/test/show/test-show b/test/show/test-show index e8cfd44b..30d825ce 100755 --- a/test/show/test-show +++ b/test/show/test-show @@ -77,7 +77,7 @@ check "$expected" "$actual" : show two non-mime # Format is different; why? cat > $expected < $expected <>> inbox:1 - - +[ Message inbox:1 ] Date: Fri, 29 Sep 2006 00:00:00 To: Some User From: Test1 @@ -108,10 +106,7 @@ Subject: Testing message 1 [ part - text/plain - 25B ] This is message number 1 - ->>> inbox:$msgnum - - +[ Message inbox:11 ] Date: Thu, 19 May 2011 00:00:00 -0000 To: recipient@example.com From: sender@example.com