X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=test%2Ftests%2Fshow%2Ftest-longlines;h=f6ae12661235b9b0780e89ec44db9ef3d0180054;hb=c42126750a40dae4c42a84c152c3be1ede3cf89e;hp=8079e4dbce5993d4414624f40c8e915df20886e9;hpb=220857595d567997752e7e10279882ceac9516ae;p=mmh diff --git a/test/tests/show/test-longlines b/test/tests/show/test-longlines index 8079e4d..f6ae126 100644 --- a/test/tests/show/test-longlines +++ b/test/tests/show/test-longlines @@ -13,16 +13,24 @@ actual=$MH_TEST_DIR/$$.actual genlongsubject() { len="${1:-998}" awk -v len="$len" 'BEGIN { - prefix = "Subject: " len + prefix = "Subject: " len " " while (i++> "$MMH/profile" +trap 'printf "/^mhl:/d\nw\nq\n" | ed - "$MMH/profile"' 0 1 2 15 + + len=997 # Write message with long header line @@ -105,3 +113,61 @@ EOF COLUMNS=2000 show $msgnum > $actual 2>&1 diff -u $expected $actual + + +# now with CRLF + + +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 | addcr` +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 | addcr` +Date: Sun, 15 Jul 2018 12:26:59 +0200 + +foo +EOF + +# check it +cat > $expected <<-EOF +mhl: format error in message 15 +part text/plain 4 +foo +EOF + +COLUMNS=2000 show $msgnum > $actual 2>&1 +diff -u $expected $actual +