1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
|
#!/usr/bin/env bash
. ./lib
switch_to_latin9_locale
rm -rf temp1
rm -rf temp2
rm -rf temp3
mkdir temp1
mkdir temp2
mkdir temp3
cd temp1
seventysevenaddy="<aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa@bbbbbbbbbb.cccccccccc.abrasoft.com>"
darcs init
echo "Have you seen the smrrebrd of Ren avsant?" > non_ascii_file
darcs add non_ascii_file
darcs record -am "non-ascii file add" -A test
cd ../temp2
darcs init
cd ../temp1
# long email adress: check that email adresses of <= 77 chars don't get split up
darcs send --mail\
--from="Kjlt berstrm $seventysevenaddy" \
--subject "Un patch pour le rpositoire" \
--to="Un garon franais <garcon@francais.fr>" \
--sendmail-command='tee mail_as_file %<' \
-a ../temp2
cat mail_as_file
# The long mail address should be in there as a whole
grep $seventysevenaddy mail_as_file
# Check that there are no non-ASCII characters in the mail
cd ../temp3
cat > is_ascii.hs <<EOF
import Data.Char (chr)
main = getContents >>= print . not . any (> Data.Char.chr 127)
EOF
runghc is_ascii < ../temp1/mail_as_file | grep True
cd ..
|