From: markus schnalke Date: Sun, 15 Jul 2018 11:41:17 +0000 (+0200) Subject: Extend test for long lines with CRLF X-Git-Tag: mmh-0.4~26 X-Git-Url: http://git.marmaro.de/?a=commitdiff_plain;h=2649858ef32645a56e78497d8268f0589b94b63f;p=mmh Extend test for long lines with CRLF --- diff --git a/test/tests/show/test-longlines b/test/tests/show/test-longlines index 8079e4d..138c724 100644 --- a/test/tests/show/test-longlines +++ b/test/tests/show/test-longlines @@ -23,6 +23,11 @@ genlongsubject() { }' } +addcr() { + awk '{printf($0 "\r\n")}' +} + + len=997 # Write message with long header line @@ -105,3 +110,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 +