Hi

repl will break urls with the format switch, depending on the size of
your terminal. A test case is attached. To reproduce run the test in a
terminal with less then 300 chars width.

Philipp
#!/bin/sh
######################################################
#
# Test repl -convertarg
#
######################################################

set -e

if test -z "${MH_OBJ_DIR}"; then
    srcdir=`dirname $0`/../..
    MH_OBJ_DIR=`cd $srcdir && pwd`; export MH_OBJ_DIR
fi

. "${srcdir}/test/post/test-post-common.sh"

expected="$MH_TEST_DIR/test-url$$.expected"
actual=`mhpath +`/draft

printf 'Local-Mailbox: recipi...@example.com\n' >>"$MH"


#### Make sure that this works with 7-bit encoding.
LC_ALL=C; export LC_ALL


# check if urls get broken
start_test 'long urls get broken on reply'
cat >"$expected" <<'EOF'
From: recipi...@example.com
To: sen...@example.com
cc: 
Fcc: +outbox
Subject: Re: test
Comments: In-reply-to sen...@example.com
   message dated "Thu, 11 Dec 2014 08:19:02 -0600."
--------
sen...@example.com writes:
> https://example.com/realy/long/path/to/some/importent/document/with/i/need/to/reference/in/the/reply/because/it/is/realy/importent/and/has/also/some/random/string/in/it/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/but/is/not/longer/than/900/chars/because/it/is/still/a/valide/mail.html
EOF

cat >`mhpath new` <<'EOF'
From: sen...@example.com
To: recipi...@example.com
Subject: test
Date: Thu, 11 Dec 2014 08:19:02 -0600

https://example.com/realy/long/path/to/some/importent/document/with/i/need/to/reference/in/the/reply/because/it/is/realy/importent/and/has/also/some/random/string/in/it/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/but/is/not/to/long/because/it/is/still/a/valide/mail.html
EOF

repl -editor true -nowhatnowproc -format last
check "$actual" "$expected"


#### Make sure that this works with 8-bit encoding.
finish_test
exit ${failed:-0}

Reply via email to