From 2649858ef32645a56e78497d8268f0589b94b63f Mon Sep 17 00:00:00 2001 From: markus schnalke Date: Sun, 15 Jul 2018 13:41:17 +0200 Subject: [PATCH] Extend test for long lines with CRLF --- test/tests/show/test-longlines | 63 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) 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 + -- 1.7.10.4