X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=test%2Ftests%2Fshow%2Ftest-longlines;fp=test%2Ftests%2Fshow%2Ftest-longlines;h=8079e4dbce5993d4414624f40c8e915df20886e9;hp=0000000000000000000000000000000000000000;hb=220857595d567997752e7e10279882ceac9516ae;hpb=4f230b2e91103abc77dcc41c46a59ba2041a2248 diff --git a/test/tests/show/test-longlines b/test/tests/show/test-longlines new file mode 100644 index 0000000..8079e4d --- /dev/null +++ b/test/tests/show/test-longlines @@ -0,0 +1,107 @@ +#!/bin/sh +###################################################### +# +# Test long header line handling (998 chars) +# +###################################################### + +set -e + +expected=$MH_TEST_DIR/$$.expected +actual=$MH_TEST_DIR/$$.actual + +genlongsubject() { + len="${1:-998}" + awk -v len="$len" 'BEGIN { + prefix = "Subject: " len + while (i++ $msgfile <<-EOF +From: foo@example.edu +To: bar@example.edu +`genlongsubject $len` +Date: Sun, 15 Jul 2018 12:26:59 +0200 + +foo +EOF + +# check it +cat > $expected <<-EOF +Date: Sun, 15 Jul 2018 12:26:59 +0200 +From: foo@example.edu +To: bar@example.edu +`genlongsubject $len` + +part text/plain 4 +foo +EOF + +COLUMNS=2000 show $msgnum > $actual 2>&1 +diff -u $expected $actual + + +len=998 + +# Write message with long header line +msgfile=$(mhpath b) +msgnum=$(basename $msgfile) +cat > $msgfile <<-EOF +From: foo@example.edu +To: bar@example.edu +`genlongsubject $len` +Date: Sun, 15 Jul 2018 12:26:59 +0200 + +foo +EOF + +# check it +cat > $expected <<-EOF +Date: Sun, 15 Jul 2018 12:26:59 +0200 +From: foo@example.edu +To: bar@example.edu +`genlongsubject $len` + +part text/plain 4 +foo +EOF + +COLUMNS=2000 show $msgnum > $actual 2>&1 +diff -u $expected $actual + + +len=999 + +# Write message with long header line +msgfile=$(mhpath b) +msgnum=$(basename $msgfile) +cat > $msgfile <<-EOF +From: foo@example.edu +To: bar@example.edu +`genlongsubject $len` +Date: Sun, 15 Jul 2018 12:26:59 +0200 + +foo +EOF + +# check it +cat > $expected <<-EOF +mhl: format error in message 13 +part text/plain 4 +foo +EOF + +COLUMNS=2000 show $msgnum > $actual 2>&1 +diff -u $expected $actual +