2 #@ Usage: ./cc-test.sh [--check-only [s-nail-binary]]
5 ARGS
='-:/ -# -Sencoding=quoted-printable -Sstealthmua -Snosave -Sexpandaddr=restrict -Sdotlock-ignore-error'
10 #UTF8_LOCALE= autodetected unless set
12 if ( command -v command ) >/dev
/null
2>&1; then :; else
19 MAKE
="${MAKE:-`command -v make`}"
20 awk=${awk:-`command -v awk`}
21 cat=${cat:-`command -v cat`}
22 cksum=${cksum:-`command -v cksum`}
23 rm=${rm:-`command -v rm`}
24 sed=${sed:-`command -v sed`}
25 grep=${grep:-`command -v grep`}
29 export SNAIL ARGS CONF BODY MBOX MAIL MAKE
awk cat cksum rm sed grep
31 LC_ALL
=C LANG
=C ADDARG_UNI
=-Sttycharset=UTF-8
33 # Wed Oct 2 01:50:07 UTC 1996
34 SOURCE_DATE_EPOCH
=844221007
36 export LC_ALL LANG ADDARG_UNI TZ SOURCE_DATE_EPOCH
38 # Problem: force $SHELL to be a real shell. It seems some testing environments
39 # use nologin(?), but we need a real shell for command execution
40 if { echo ${SHELL} | ${grep} nologin; } >/dev
/null
2>&1; then
41 echo >&2 '$SHELL seems to be nologin, overwriting to /bin/sh!'
46 if [ -z "${UTF8_LOCALE}" ]; then
48 if command -v locale
>/dev
/null
2>&1; then
49 UTF8_LOCALE
=`locale -a | { m=
51 if { echo ${n} | ${grep} -i 'utf-\{0,1\}8'; } >/dev/null 2>&1; then
53 if { echo ${n} | ${grep} -e POSIX -e en_EN -e en_US; }; then
67 echo >&2 "Usage: ./cc-test.sh [--check-only [s-nail-binary]]"
73 [ "${1}" = --check-only ] || usage
74 [ ${#} -gt 2 ] && usage
75 [ ${#} -eq 2 ] && SNAIL
="${2}"
76 [ -x "${SNAIL}" ] || usage
81 trap "${rm} -rf \"${BODY}\" \"${MBOX}\" \${TRAP_EXIT_ADDONS}" EXIT
82 trap "exit 1" HUP INT TERM
85 # Test all configs TODO doesn't cover all *combinations*, stupid!
89 NOTME["OPT_AUTOCC"] = 1
90 NOTME["OPT_DEBUG"] = 1
91 NOTME["OPT_DEVEL"] = 1
92 NOTME["OPT_NOEXTMD5"] = 1
93 NOTME["OPT_NOMEMDBG"] = 1
98 sub(/^[[:space:]]*/, "")
99 # This bails for UnixWare 7.1.4 awk(1), but preceeding = with \
100 # does not seem to be a compliant escape for =
102 $1 = substr($1, 1, index($1, "=") - 1)
108 # Doing this completely sequentially and not doing make distclean in
109 # between runs should effectively result in lesser compilations.
110 # It is completely dumb nonetheless... TODO
111 for (j = 1; j < i; ++j) {
112 for (k = 1; k < j; ++k)
114 for (k = j; k < i; ++k)
116 printf "OPT_AUTOCC=1\n"
118 for (j = 1; j < i; ++j) {
119 for (k = 1; k < j; ++k)
121 for (k = j; k < i; ++k)
123 printf "OPT_AUTOCC=1\n"
126 for (j = 1; j < i; ++j) {
127 for (k = 1; k < j; ++k)
129 for (k = j; k < i; ++k)
131 printf "OPT_AUTOCC=1\n"
132 printf "OPT_DEBUG=1\n"
134 for (j = 1; j < i; ++j) {
135 for (k = 1; k < j; ++k)
137 for (k = j; k < i; ++k)
139 printf "OPT_AUTOCC=1\n"
140 printf "OPT_DEBUG=1\n"
143 printf "CONFIG=NULL OPT_AUTOCC=0\n"
144 printf "CONFIG=NULL OPT_AUTOCC=1\n"
145 printf "CONFIG=NULLI OPT_AUTOCC=0\n"
146 printf "CONFIG=NULLI OPT_AUTOCC=1\n"
147 printf "CONFIG=MINIMAL OPT_AUTOCC=0\n"
148 printf "CONFIG=MINIMAL OPT_AUTOCC=1\n"
149 printf "CONFIG=MEDIUM OPT_AUTOCC=0\n"
150 printf "CONFIG=MEDIUM OPT_AUTOCC=1\n"
151 printf "CONFIG=NETSEND OPT_AUTOCC=0\n"
152 printf "CONFIG=NETSEND OPT_AUTOCC=1\n"
153 printf "CONFIG=MAXIMAL OPT_AUTOCC=0\n"
154 printf "CONFIG=MAXIMAL OPT_AUTOCC=1\n"
155 printf "CONFIG=DEVEL OPT_AUTOCC=0\n"
156 printf "CONFIG=DEVEL OPT_AUTOCC=1\n"
157 printf "CONFIG=ODEVEL OPT_AUTOCC=0\n"
158 printf "CONFIG=ODEVEL OPT_AUTOCC=1\n"
161 printf "\n\n##########\n$c\n"
162 printf "\n\n##########\n$c\n" >&2
170 # Read mailbox $2, strip non-constant headers and MIME boundaries, query the
171 # cksum(1) of the resulting data and compare against the checksum $3
173 tid
=${1} f=${2} s=${3}
175 csum
="`${sed} -e '/^From /d' \
176 -e '/^ boundary=/d' -e '/^--=-=/d' < \"${f}\" \
177 -e '/^\[-- Message/d' | ${cksum}`";
178 if [ "${csum}" = "${s}" ]; then
182 printf 'error: checksum mismatch (got %s)\n' "${csum}"
187 ( "${SNAIL}" ${ARGS} -X'echo $features' -Xx | ${grep} +${1} ) >/dev/null 2>&1
191 # Basic (easily testable) behaviour tests
193 __behave_x_opt_input_command_stack
195 __behave_input_inject_semicolon_seq
199 __behave_macro_param_shift
203 # FIXME __behave_alias
205 # FIXME __behave_mlist
207 have_feat smime && __behave_smime
210 __behave_x_opt_input_command_stack() {
211 ${cat} <<- '__EOT' > "${BODY}"
219 echo "define mac1
{";\
220 echo " echo mac1-1 via1 \
$0";\
222 echo " echo mac1-2
";\
224 echo " echo mac1-3
";\
227 echo "define mac2
{";\
228 echo " echo mac2-1 via1 \
$0";\
230 echo " echo mac2-2
";\
235 echo "wysh
source \"\
236 echo echo 1-1-1 via1 \
$0;\
248 # The -X option supports multiline arguments, and those can internally use
249 # reverse solidus newline escaping. And all -X options are joined...
251 < "${BODY}" "${SNAIL}" ${ARGS} \
265 wysh source '${APO}'\
266 echo "define mac1 {";\
267 echo " echo mac1-1 via2 \$0";\
269 echo " echo mac1-2";\
271 echo " echo mac1-3";\
274 echo "define mac2 {";\
275 echo " echo mac2-1 via2 \$0";\
277 echo " echo mac2-2";\
282 echo "wysh source \"\
283 echo echo 1-1-1 via2 \$0;\
295 ' > "${MBOX}" 2>/dev
/null
340 cksum_test behave
:x_opt_input_command_stack
"${MBOX}" '1391275936 378'
344 ${cat} <<- '__EOT' > "${BODY}"
363 echo 'a${DIET}b${TIED}c\${DIET}d\${TIED}e' # COMMENT
364 echo "a${DIET}b${TIED}c\${DIET}d\${TIED}e"
365 echo $'a${DIET}b${TIED}c\${DIET}d\${TIED}e'
367 echo a$'\101\0101\x41\u0041\u41\U00000041\U41'c
368 echo a$'\u0041\u41\u0C1\U00000041\U41'c
391 echo a$'b\U0000000'dt
392 echo a$'b\U00000000'du
402 if [ -z "${UTF8_LOCALE}" ]; then
403 echo 'Skip behave:wysh_unicode, no UTF8_LOCALE'
405 < "${BODY}" DIET=CURD TIED= \
406 LC_ALL=${UTF8_LOCALE} "${SNAIL}" ${ARGS} 2>/dev/null > "${MBOX}"
422 #a${DIET}b${TIED}c\${DIET}d\${TIED}e
423 #aCURDbc${DIET}d${TIED}e
424 #a${DIET}b${TIED}cCURDde
453 cksum_test behave:wysh_unicode "${MBOX}" '475805847 317'
456 < "${BODY}" DIET=CURD TIED= "${SNAIL}" ${ARGS} > "${MBOX}" 2>/dev/null
472 #a${DIET}b${TIED}c\${DIET}d\${TIED}e
473 #aCURDbc${DIET}d${TIED}e
474 #a${DIET}b${TIED}cCURDde
503 cksum_test behave:wysh_c "${MBOX}" '1473887148 321'
506 __behave_input_inject_semicolon_seq() {
507 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} > "${MBOX}"
512 echon this_is_mymac;call mydeepmac;echon ';';
514 echon one';';~mymac;echon two";";call mymac;echo three$';';
516 echon this_is_mymac;call mydeepmac;echon ,TOO'!;';
518 echon one';';~mymac;echon two";";call mymac;echo three$';';
520 #one;this_is_mymac(mydeepmac);two;this_is_mymac(mydeepmac);three;
521 #one;this_is_mymac(mydeepmac),TOO!;two;this_is_mymac(mydeepmac),TOO!;three;
522 cksum_test behave:input_inject_semicolon_seq "${MBOX}" '512117110 140'
526 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} > "${MBOX}"
534 ghost XxXxXx echo huhu
535 ghost XxXxXxX echo huhu
543 cksum_test behave:ghost "${MBOX}" '776950759 26'
548 # Nestable conditions test
549 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} > "${MBOX}"
571 if $dietcurd == 'yoho'
576 if $dietcurd != 'yoho'
637 if $dietcurd == 'yohu'
639 elif $dietcurd == 'yoha'
641 elif $dietcurd == 'yohe'
643 elif $dietcurd == 'yoho'
645 if $dietcurd == 'yohu'
647 elif $dietcurd == 'yoha'
649 elif $dietcurd == 'yohe'
651 elif $dietcurd == 'yoho'
653 if $dietcurd == 'yohu'
655 elif $dietcurd == 'yoha'
657 elif $dietcurd == 'yohe'
659 elif $dietcurd == 'yoho'
670 # integer conversion, <..>..
773 set diet=abc curd=abc
779 set diet=abc curd=abcd
785 # 1. Shitty grouping capabilities as of today
786 unset diet curd ndefined
787 if [ [ false ] || [ false ] || [ true ] ] && [ [ false ] || [ true ] ] && \
793 if [ [ [ [ 0 ] || [ 1 ] ] && [ [ 1 ] || [ 0 ] ] ] && [ 1 ] ] && [ yes ]
798 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] ]
803 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] ]
808 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] || [ 1 ] ] && [ no ]
813 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] || [ 1 ] ] \
819 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 1 ] ]
824 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 0 ] ]
829 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 0 ] ] && [ 1 ] ] ] && [ 1 ] ]
834 if [ [ [ [ [ [ [ 0 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 1 ] ]
839 if [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] && [ 0 ]
844 if [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] && [ 1 ]
849 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ]
854 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 1 ]
859 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ] || [ 1 ] && [ 0 ]
864 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ] || [ 1 ] && [ 1 ]
870 if [ [ $diet == 'yo' ] && [ $curd == 'ho' ] ] && [ $ndefined ]
876 if [ [ $diet == 'yo' ] && [ $curd == 'ho' ] ] && [ $ndefined ]
881 # 2. Shitty grouping capabilities as of today
882 unset diet curd ndefined
883 if [ false || false || true ] && [ false || true ] && yes
888 if [ [ [ 0 || 1 ] && [ 1 || 0 ] ] && 1 ] && [ yes ]
893 if [ 1 || 0 || 0 || 0 ]
898 if [ 1 || 0 || 0 || 0 || [ 1 ] ]
903 if [ 1 || 0 || 0 || 0 || [ 1 ] || 1 ] && no
908 if [ 1 || 0 || 0 || 0 || 1 || [ 1 ] ] && no || [ yes ]
913 if [ [ [ [ [ [ 1 ] && 1 ] && 1 ] && 1 ] ] && [ 1 ] ]
918 if [ [ [ [ [ [ 1 ] && 1 ] && 1 ] && [ 1 ] ] ] && 0 ]
923 if [ [ [ [ [ [ [ 1 ] ] && 1 ] && 0 ] && [ 1 ] ] ] && 1 ]
928 if [ [ [ [ [ [ 0 ] && 1 ] && 1 ] && 1 ] ] && 1 ]
933 if 1 || 0 || 0 || 0 && 0
938 if 1 || 0 || 0 || 0 && 1
943 if 0 || 0 || 0 || 1 && 0
948 if 0 || 0 || 0 || 1 && 1
953 if 0 || 0 || 0 || 1 && 0 || 1 && 0
958 if 0 || 0 || 0 || 1 && 0 || 1 && 1
964 if [ $diet == 'yo' && $curd == 'ho' ] && $ndefined
969 if $diet == 'yo' && $curd == 'ho' && $ndefined
975 if [ $diet == 'yo' && $curd == 'ho' ] && $ndefined
980 if $diet == 'yo' && $curd == 'ho' && $ndefined
985 if [ [ [ [ [ [ $diet == 'yo' && $curd == 'ho' && $ndefined ] ] ] ] ] ]
990 # Some more en-braced variables
992 if ${diet} == ${curd}
997 if ${diet} != ${curd}
1013 if ! 0 && ! ! 1 && ! ! ! ! 2 && 3
1018 if ! 0 && ! [ ! 1 ] && ! [ ! [ ! [ ! 2 ] ] ] && 3
1023 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
1028 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && ! 3
1033 if [ ! 0 ] && [ ! [ ! 1 ] ] && ! [ [ ! [ ! [ ! [ 2 ] ] ] ] ] && ! 3
1038 if [ ! 0 ] && ! [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
1043 if ! [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
1048 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] || 3
1053 if [ ! 0 ] && [ ! ! [ ! ! 1 ] ] && [ ! ! [ ! ! [ ! ! [ ! ! [ 2 ] ] ] ] ]
1059 if ! 0 && ! ! 1 && ! ! ! 0 && 3
1064 if ! 0 && ! [ ! 1 ] && ! [ ! [ ! [ 0 ] ] ] && 3
1069 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ [ 0 ] ] ] ] ] && 3
1074 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! ! [ ! [ ! 0 ] ] ] ] && ! 3
1079 if [ ! 0 ] && [ ! [ ! 1 ] ] && ! [ ! [ ! [ ! [ ! 0 ] ] ] ] && 3
1084 if [ ! 0 ] && ! [ ! [ ! 1 ] ] && [ ! ! [ ! [ ! [ ! [ 0 ] ] ] ] ] && 3
1089 if ! [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! ! 0 ] ] ] ] && 3
1094 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ ! 0 ] ] ] ] ] || 3
1099 if [ ! 0 ] && [ ! ! [ ! ! 1 ] ] && [ ! ! [ ! ! [ ! ! [ ! [ 0 ] ] ] ] ]
1105 cksum_test behave:if-normal "${MBOX}" '557629289 631'
1107 if have_feat regex; then
1108 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} > "${MBOX}"
1110 if $dietcurd =~ '^yo.*'
1115 if $dietcurd =~ '^yoho.+'
1120 if $dietcurd !~ '.*ho$'
1125 if $dietcurd !~ '.+yoho$'
1130 if [ $dietcurd !~ '.+yoho$' ]
1135 if ! [ $dietcurd =~ '.+yoho$' ]
1140 if ! ! [ $dietcurd !~ '.+yoho$' ]
1145 if ! [ ! [ $dietcurd !~ '.+yoho$' ] ]
1150 if [ ! [ ! [ $dietcurd !~ '.+yoho$' ] ] ]
1155 if ! [ ! [ ! [ $dietcurd !~ '.+yoho$' ] ] ]
1160 if ! ! ! $dietcurd !~ '.+yoho$'
1165 if ! ! ! $dietcurd =~ '.+yoho$'
1170 if ! [ ! ! [ ! [ $dietcurd !~ '.+yoho$' ] ] ]
1175 set diet=abc curd='^abc$'
1181 set diet=abc curd='^abcd$'
1188 cksum_test behave:if-regex "${MBOX}" '439960016 81'
1192 __behave_localopts() {
1193 # Nestable conditions test
1194 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} > "${MBOX}"
1209 echo $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2
1214 echo $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2
1215 echo "$gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2"
1224 echo active trouble: $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t3
1226 echo active null: $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t3
1232 #gv1 lv1 lv2 lv3 gv2, t2
1240 #gv1 lv1 lv2 lv3 gv2, t2
1243 #active trouble: gv1 gv2,
1245 cksum_test behave:localopts "${MBOX}" '1936527193 192'
1248 __behave_macro_param_shift() {
1249 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} > "${MBOX}" 2>/dev/null
1252 echo t2.0 has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1257 echo t2.1 has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1258 if [ $# > 1 ] || [ $ignerr == '' ]
1263 echo t2.2:$? has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1265 echo t2.3:$? has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1269 echo t2.4:$? has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1273 call t2 1 you get four args
1274 echo t1.1: $?';' ignerr ($ignerr) should not exist
1275 call t2 1 you get 'three args'
1276 echo t1.2: $?';' ignerr ($ignerr) should not exist
1277 call t2 1 you 'get two args'
1278 echo t1.3: $?';' ignerr ($ignerr) should not exist
1279 call t2 1 'you get one arg'
1280 echo t1.4: $?';' ignerr ($ignerr) should not exist
1281 ignerr call t2 '' 'you get one arg'
1282 echo t1.5: $?';' ignerr ($ignerr) should not exist
1288 #t2.0 has 5/5 parameters: 1,you,get (1 you get four args) [1 you get four args]
1289 #t2.1 has 4/4 parameters: you,get,four (you get four args) [you get four args]
1290 #t2.2:0 has 2/2 parameters: four,args, (four args) [four args]
1291 #t2.3:0 has 2/2 parameters: four,args, (four args) [four args]
1292 #t2.4:0 has 1/1 parameters: args,, (args) [args]
1293 #t1.1: 0; ignerr () should not exist
1295 #t2.0 has 4/4 parameters: 1,you,get (1 you get three args) [1 you get three args]
1296 #t2.1 has 3/3 parameters: you,get,three args (you get three args) [you get three args]
1297 #t2.2:0 has 1/1 parameters: three args,, (three args) [three args]
1298 #t2.3:0 has 1/1 parameters: three args,, (three args) [three args]
1299 #t2.4:0 has 0/0 parameters: ,, () []
1300 #t1.2: 0; ignerr () should not exist
1302 #t2.0 has 3/3 parameters: 1,you,get two args (1 you get two args) [1 you get two args]
1303 #t2.1 has 2/2 parameters: you,get two args, (you get two args) [you get two args]
1304 #t2.2:0 has 0/0 parameters: ,, () []
1305 #t2.3:0 has 0/0 parameters: ,, () []
1306 #t2.4:0 has 0/0 parameters: ,, () []
1307 #t1.3: 0; ignerr () should not exist
1309 #t2.0 has 2/2 parameters: 1,you get one arg, (1 you get one arg) [1 you get one arg]
1310 #t2.1 has 1/1 parameters: you get one arg,, (you get one arg) [you get one arg]
1311 #t2.2:0 has 1/1 parameters: you get one arg,, (you get one arg) [you get one arg]
1312 #t2.3:0 has 1/1 parameters: you get one arg,, (you get one arg) [you get one arg]
1313 #t2.4:0 has 0/0 parameters: ,, () []
1314 #t1.4: 0; ignerr () should not exist
1316 #t2.0 has 2/2 parameters: ,you get one arg, ( you get one arg) [ you get one arg]
1317 #t2.1 has 1/1 parameters: you get one arg,, (you get one arg) [you get one arg]
1318 #t1.5: 1; ignerr () should not exist
1319 cksum_test behave:macro_param_shift "${MBOX}" '1402489146 1682'
1322 __behave_addrcodec() {
1323 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} > "${MBOX}" 2>/dev/null
1324 vput addrcodec res 1 <doog@def>
1326 vput addrcodec res 2 . <doog@def>
1328 vput addrcodec res 3 Sauer Dr. <doog@def>
1330 vput addrcodec res 4 Sauer (Ma) Dr. <doog@def>
1332 vput addrcodec res 5 Sauer (Ma) Braten Dr. <doog@def>
1334 vput addrcodec res 6 Sauer (Ma) Braten Dr. (Heu) <doog@def>
1336 vput addrcodec res 7 Sauer (Ma) Braten Dr. (Heu) <doog@def> (bu)
1338 vput addrcodec res 8 \
1339 Dr. Sauer (Ma) Braten Dr. (Heu) <doog@def> (bu) Boom. Boom
1341 vput addrcodec res 9 Dr.Sauer(Ma)Braten Dr. (Heu) <doog@def>
1343 vput addrcodec res 10 (Ma)Braten Dr. (Heu) <doog@def>
1345 vput addrcodec res 11 (Ma)Braten Dr'"."' (Heu) <doog@def>
1347 vput addrcodec res 12 \
1348 ' Dr. ' ' Sauer ' (Ma) ' Braten ' ' Dr. ' (u) <doog@def>
1350 vput addrcodec res 13(Ma)Braten Dr. (Heu) <doog@def>
1352 vput addrcodec res 14 Hey, Du <doog@def> Wie() findet Dr. das? ()
1354 vput addrcodec res 15 \
1355 Hey, Du <doog@def> Wie() findet '""' Dr. '""' das? ()
1357 vput addrcodec res 16 \
1358 \"Hey,\" \"Du\" <doog@def> \"Wie()\" findet \"\" Dr. \"\" das? ()
1360 vput addrcodec res 17 \
1361 \"Hey\" Du <doog@def> \"Wie() findet \" \" Dr. \"\"\" das? ()
1363 vput addrcodec res 18 \
1364 <doog@def> \"Hey\" Du \"Wie() findet \" \" Dr. \"\"\" das? ()
1366 vput addrcodec res 19 \
1367 'Hey\,\" ' <doog@def> '"Wie()" findet \" Dr. \"' das? ()
1372 #0 "3 Sauer Dr." <doog@def>
1373 #0 4 Sauer (Ma) "Dr." <doog@def>
1374 #0 5 Sauer (Ma) "Braten Dr." <doog@def>
1375 #0 6 Sauer (Ma) "Braten Dr." (Heu) <doog@def>
1376 #0 7 Sauer (Ma) "Braten Dr." (Heu bu) <doog@def>
1377 #0 "8 Dr. Sauer" (Ma) "Braten Dr." (Heu bu) "Boom. Boom" <doog@def>
1378 #0 "9 Dr.Sauer" (Ma) "Braten Dr." (Heu) <doog@def>
1379 #0 10 (Ma) "Braten Dr." (Heu) <doog@def>
1380 #0 11 (Ma) "Braten Dr\".\"" (Heu) <doog@def>
1381 #0 "12 Dr. Sauer" (Ma) "Braten Dr." (u) <doog@def>
1382 #0 13 (Ma) "Braten Dr." (Heu) <doog@def>
1383 #0 "14 Hey, Du Wie" () "findet Dr. das?" () <doog@def>
1384 #0 "15 Hey, Du Wie" () "findet \"\" Dr. \"\" das?" () <doog@def>
1385 #0 "16 \"Hey,\" \"Du\" \"Wie" () "\" findet \"\" Dr. \"\" das?" () <doog@def>
1386 #0 "17 \"Hey\" Du \"Wie" () "findet \" \" Dr. \"\"\" das?" () <doog@def>
1387 #0 "18 \"Hey\" Du \"Wie" () "findet \" \" Dr. \"\"\" das?" () <doog@def>
1388 #0 "19 Hey\\,\\\" \"Wie" () "\" findet \\\" Dr. \\\" das?" () <doog@def>
1389 cksum_test behave:addrcodec "${MBOX}" '1997352922 927'
1393 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} > "${MBOX}" 2>/dev/null
1394 vput vexpr res = 9223372036854775807
1396 vput vexpr res = 9223372036854775808
1398 vput vexpr res =@ 9223372036854775808
1400 vput vexpr res = -9223372036854775808
1402 vput vexpr res = -9223372036854775809
1404 vput vexpr res =@ -9223372036854775809
1414 vput vexpr res + 0 0
1416 vput vexpr res + 0 1
1418 vput vexpr res + 1 1
1421 vput vexpr res + 9223372036854775807 0
1423 vput vexpr res + 9223372036854775807 1
1425 vput vexpr res +@ 9223372036854775807 1
1427 vput vexpr res + 0 9223372036854775807
1429 vput vexpr res + 1 9223372036854775807
1431 vput vexpr res +@ 1 9223372036854775807
1434 vput vexpr res + -9223372036854775808 0
1436 vput vexpr res + -9223372036854775808 -1
1438 vput vexpr res +@ -9223372036854775808 -1
1440 vput vexpr res + 0 -9223372036854775808
1442 vput vexpr res + -1 -9223372036854775808
1444 vput vexpr res +@ -1 -9223372036854775808
1447 vput vexpr res - 0 0
1449 vput vexpr res
- 0 1
1451 vput vexpr res
- 1 1
1454 vput vexpr res
- 9223372036854775807 0
1456 vput vexpr res
- 9223372036854775807 -1
1458 vput vexpr res
-@
9223372036854775807 -1
1460 vput vexpr res
- 0 9223372036854775807
1462 vput vexpr res
- -1 9223372036854775807
1464 vput vexpr res
- -2 9223372036854775807
1466 vput vexpr res
-@
-2 9223372036854775807
1469 vput vexpr res
- -9223372036854775808 +0
1471 vput vexpr res
- -9223372036854775808 +1
1473 vput vexpr res
-@
-9223372036854775808 +1
1475 vput vexpr res
- 0 -9223372036854775808
1477 vput vexpr res
- +1 -9223372036854775808
1479 vput vexpr res
-@
+1 -9223372036854775808
1482 vput vexpr res
+ -13 -2
1484 vput vexpr res
- 0 0
1486 vput vexpr res
- 0 1
1488 vput vexpr res
- 1 1
1490 vput vexpr res
- -13 -2
1493 vput vexpr res
* 0 0
1495 vput vexpr res
* 0 1
1497 vput vexpr res
* 1 1
1499 vput vexpr res
* -13 -2
1502 vput vexpr res
/ 0 0
1504 vput vexpr res
/ 0 1
1506 vput vexpr res
/ 1 1
1508 vput vexpr res
/ -13 -2
1511 vput vexpr res
% 0 0
1513 vput vexpr res
% 0 1
1515 vput vexpr res
% 1 1
1517 vput vexpr res
% -13 -2
1520 #0 9223372036854775807
1522 #1 9223372036854775807
1523 #0 -9223372036854775808
1525 #1 -9223372036854775808
1535 #0 9223372036854775807
1537 #1 9223372036854775807
1538 #0 9223372036854775807
1540 #1 9223372036854775807
1542 #0 -9223372036854775808
1544 #1 -9223372036854775808
1545 #0 -9223372036854775808
1547 #1 -9223372036854775808
1553 #0 9223372036854775807
1555 #1 9223372036854775807
1556 #0 -9223372036854775807
1557 #0 -9223372036854775808
1559 #1 -9223372036854775808
1561 #0 -9223372036854775808
1563 #1 -9223372036854775808
1564 #0 -9223372036854775808
1566 #1 -9223372036854775808
1588 cksum_test behave
:vexpr-numeric
"${MBOX}" '2147139513 687'
1590 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} > "${MBOX}" #2>/dev/null
1591 vput vexpr res find 'bananarama' 'nana'
1593 vput vexpr res find 'bananarama' 'bana'
1595 vput vexpr res find 'bananarama' 'Bana'
1597 vput vexpr res find 'bananarama' 'rama'
1600 vput vexpr res ifind 'bananarama' 'nana'
1602 vput vexpr res ifind 'bananarama' 'bana'
1604 vput vexpr res ifind 'bananarama' 'Bana'
1606 vput vexpr res ifind 'bananarama' 'rama'
1609 vput vexpr res substring 'bananarama' 1
1611 vput vexpr res substring 'bananarama' 3
1613 vput vexpr res substring 'bananarama' 5
1615 vput vexpr res substring 'bananarama' 7
1617 vput vexpr res substring 'bananarama' 9
1619 vput vexpr res substring 'bananarama' 10
1621 vput vexpr res substring 'bananarama' 1 3
1623 vput vexpr res substring 'bananarama' 3 3
1625 vput vexpr res substring 'bananarama' 5 3
1627 vput vexpr res substring 'bananarama' 7 3
1629 vput vexpr res substring 'bananarama' 9 3
1631 vput vexpr res substring 'bananarama' 10 3
1658 cksum_test behave:vexpr-string "${MBOX}" '2171181036 119'
1660 if have_feat regex; then
1661 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} > "${MBOX}" #2>/dev/null
1662 vput vexpr res regex
'bananarama' 'nana'
1664 vput vexpr res regex
'bananarama' 'bana'
1666 vput vexpr res regex
'bananarama' 'Bana'
1668 vput vexpr res regex
'bananarama' 'rama'
1671 vput vexpr res iregex
'bananarama' 'nana'
1673 vput vexpr res iregex
'bananarama' 'bana'
1675 vput vexpr res iregex
'bananarama' 'Bana'
1677 vput vexpr res iregex
'bananarama' 'rama'
1680 vput vexpr res regex
'bananarama' '(.*)nana(.*)' '\${1}a\${0}u{\$2}'
1682 vput vexpr res regex
'bananarama' '(.*)bana(.*)' '\${1}a\${0}u\$2'
1684 vput vexpr res regex
'bananarama' 'Bana(.+)' '\$1\$0'
1686 vput vexpr res regex
'bananarama' '(.+)rama' '\$1\$0'
1689 vput vexpr res iregex
'bananarama' '(.*)nana(.*)' '\${1}a\${0}u{\$2}'
1691 vput vexpr res iregex
'bananarama' '(.*)bana(.*)' '\${1}a\${0}u\$2'
1693 vput vexpr res iregex
'bananarama' 'Bana(.+)' '\$1\$0'
1695 vput vexpr res iregex
'bananarama' '(.+)rama' '\$1\$0'
1709 #0 baabananaramau{rama}
1710 #0 abananaramaunarama
1714 #0 baabananaramau{rama}
1715 #0 abananaramaunarama
1719 cksum_test behave
:vexpr-regex
"${MBOX}" '3419299180 199'
1723 __behave_smime
() { # FIXME add test/ dir, unroll tests therein
1724 TRAP_EXIT_ADDONS
="./.t.conf ./.tkey.pem ./.tcert.pem ./.tpair.pem"
1725 TRAP_EXIT_ADDONS
="${TRAP_EXIT_ADDONS} ./.VERIFY ./.DECRYPT ./.ENCRYPT"
1726 TRAP_EXIT_ADDONS
="${TRAP_EXIT_ADDONS} ./.tsendmail.sh"
1728 printf 'behave:s/mime: .. generating test key and certificate ..\n'
1729 ${cat} <<-_EOT > ./.t.conf
1732 default_keyfile = keyfile.pem
1733 distinguished_name = req_distinguished_name
1734 attributes = req_attributes
1738 [ req_distinguished_name ]
1745 emailAddress = test@localhost
1750 openssl req
-x509 -nodes -days 3650 -config .
/.t.conf \
1751 -newkey rsa
:1024 -keyout .
/.tkey.pem
-out .
/.tcert.pem
>/dev
/null
2>&1
1752 ${cat} .
/.tkey.pem .
/.tcert.pem
> .
/.tpair.pem
1754 printf "behave:s/mime:sign/verify: "
1755 echo bla |
"${SNAIL}" ${ARGS} \
1756 -Ssmime-ca-file=.
/.tcert.pem
-Ssmime-sign-cert=.
/.tpair.pem \
1757 -Ssmime-sign -Sfrom=test@localhost \
1758 -s 'S/MIME test' .
/.VERIFY
1759 printf 'verify\nx\n' |
1760 "${SNAIL}" ${ARGS} \
1761 -Ssmime-ca-file=.
/.tcert.pem
-Ssmime-sign-cert=.
/.tpair.pem \
1762 -Ssmime-sign -Sfrom=test@localhost \
1763 -Sbatch-exit-on-error -R \
1764 -f .
/.VERIFY
>/dev
/null
2>&1
1765 if [ $?
-eq 0 ]; then
1768 printf 'error: verification failed\n'
1770 ${rm} -f ${TRAP_EXIT_ADDONS}
1774 printf ' .. disproof via openssl smime(1): '
1775 if openssl smime
-verify -CAfile .
/.tcert.pem \
1776 -in .
/.VERIFY
>/dev
/null
2>&1; then
1781 ${rm} -f ${TRAP_EXIT_ADDONS}
1786 # (signing +) encryption / decryption
1787 ${cat} <<-_EOT > ./.tsendmail.sh
1790 (echo 'From S-Postman Thu May 10 20:40:54 2012' && ${cat}) > ./.ENCRYPT
1792 chmod 0755 .
/.tsendmail.sh
1794 printf "behave:s/mime:encrypt+sign/decrypt+verify: "
1796 "${SNAIL}" ${ARGS} \
1797 -Ssmime-force-encryption \
1798 -Ssmime-encrypt-recei@ver.com
=.
/.tpair.pem \
1799 -Smta=.
/.tsendmail.sh \
1800 -Ssmime-ca-file=.
/.tcert.pem
-Ssmime-sign-cert=.
/.tpair.pem \
1801 -Ssmime-sign -Sfrom=test@localhost \
1802 -s 'S/MIME test' recei@ver.com
1804 printf 'decrypt ./.DECRYPT\nfi ./.DECRYPT\nverify\nx\n' |
1805 "${SNAIL}" ${ARGS} \
1806 -Ssmime-force-encryption \
1807 -Ssmime-encrypt-recei@ver.com
=.
/.tpair.pem \
1808 -Smta=.
/.tsendmail.sh \
1809 -Ssmime-ca-file=.
/.tcert.pem
-Ssmime-sign-cert=.
/.tpair.pem \
1810 -Ssmime-sign -Sfrom=test@localhost \
1811 -Sbatch-exit-on-error -R \
1812 -f .
/.ENCRYPT
>/dev
/null
2>&1
1813 if [ $?
-eq 0 ]; then
1817 printf 'error: decryption+verification failed\n'
1819 printf ' ..disproof via openssl smime(1): '
1820 if (openssl smime
-decrypt -inkey .
/.tkey.pem
-in .
/.ENCRYPT |
1821 openssl smime
-verify -CAfile .
/.tcert.pem
) >/dev
/null
2>&1; then
1827 ${sed} -e '/^Date:/d' -e '/^X-Decoding-Date/d' \
1829 '/^Content-Disposition: attachment; filename="smime.p7s"/,/^-- /d' \
1830 < .
/.DECRYPT
> .
/.ENCRYPT
1831 cksum_test
".. checksum of decrypted content" "./.ENCRYPT" '3090916509 510'
1833 printf "behave:s/mime:encrypt/decrypt: "
1835 echo bla |
"${SNAIL}" ${ARGS} \
1836 -Ssmime-force-encryption \
1837 -Ssmime-encrypt-recei@ver.com
=.
/.tpair.pem \
1838 -Smta=.
/.tsendmail.sh \
1839 -Ssmime-ca-file=.
/.tcert.pem
-Ssmime-sign-cert=.
/.tpair.pem \
1840 -Sfrom=test@localhost \
1841 -s 'S/MIME test' recei@ver.com
1842 printf 'decrypt ./.DECRYPT\nx\n' |
"${SNAIL}" ${ARGS} \
1843 -Ssmime-force-encryption \
1844 -Ssmime-encrypt-recei@ver.com
=.
/.tpair.pem \
1845 -Smta=.
/.tsendmail.sh \
1846 -Ssmime-ca-file=.
/.tcert.pem
-Ssmime-sign-cert=.
/.tpair.pem \
1847 -Sfrom=test@localhost \
1848 -Sbatch-exit-on-error -R \
1849 -f .
/.ENCRYPT
>/dev
/null
2>&1
1850 if [ $?
-eq 0 ]; then
1854 printf 'error: decryption failed\n'
1856 printf '.. disproof via openssl smime(1): '
1857 if openssl smime
-decrypt -inkey .
/.tkey.pem \
1858 -in .
/.ENCRYPT
>/dev
/null
2>&1; then
1864 ${sed} -e '/^Date:/d' -e '/^X-Decoding-Date/d' \
1865 < .
/.DECRYPT
> .
/.ENCRYPT
1866 cksum_test
".. checksum of decrypted content" .
/.ENCRYPT
'999887248 295'
1868 ${rm} -f ${TRAP_EXIT_ADDONS}
1873 # Some basic tests regarding correct sending of mails, via STDIN / -t / -q,
1874 # including basic MIME Content-Transfer-Encoding correctness (quoted-printable)
1875 # Note we unfortunately need to place some statements without proper
1876 # indentation because of continuation problems
1878 # MIME encoding (QP) stress message body
1880 'Ich bin eine DÖS-Datäi mit sehr langen Zeilen und auch '\
1881 'sonst bin ich ganz schön am Schleudern, da kannste denke '\
1882 "wasde willst, gelle, gelle, gelle, gelle, gelle.\r\n"\
1883 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst \r\n"\
1884 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 1\r\n"\
1885 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 12\r\n"\
1886 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 123\r\n"\
1887 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 1234\r\n"\
1888 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 12345\r\n"\
1889 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 123456\r\n"\
1890 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 1234567\r\n"\
1891 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 12345678\r\n"\
1892 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 123456789\r\n"\
1893 "Unn ausserdem habe ich trailing SP/HT/SP/HT whitespace \r\n"\
1894 "Unn ausserdem habe ich trailing HT/SP/HT/SP whitespace \r\n"\
1895 "auf den zeilen vorher.\r\n"\
1896 "From am Zeilenbeginn und From der Mitte gibt es auch.\r\n"\
1898 "Die letzte Zeile war nur ein Punkt.\r\n"\
1900 "Das waren deren zwei.\r\n"\
1902 "Die letzte Zeile war ein Leerschritt.\n"\
1903 "=VIER = EQUAL SIGNS=ON A LINE=\r\n"\
1906 "Die letzte Zeile war nur ein Punkt, mit Unix Zeilenende.\n"\
1908 "Das waren deren zwei. ditto.\n"\
1910 "Unn ausseerdem habe ich trailing SP/HT/SP/HT whitespace \n"\
1911 "Unn ausseerdem habe ich trailing HT/SP/HT/SP whitespace \n"\
1912 "auf den zeilen vorher.\n"\
1914 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.\n"\
1915 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.1"\
1917 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
1919 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
1921 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
1923 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
1925 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
1927 "QP am Zeilenende über soft-nl hinweg\n"\
1928 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende."\
1930 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende."\
1932 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende."\
1934 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende."\
1936 "=VIER = EQUAL SIGNS=ON A LINE=\n"\
1938 "Die letzte Zeile war ein Leerschritt.\n"\
1942 # MIME encoding (QP) stress message subject
1943 SUB
="Äbrä Kä?dä=brö Fü?di=bus? \
1944 adadaddsssssssddddddddddddddddddddd\
1945 ddddddddddddddddddddddddddddddddddd\
1946 ddddddddddddddddddddddddddddddddddd\
1947 dddddddddddddddddddd Hallelulja? Od\
1948 er?? eeeeeeeeeeeeeeeeeeeeeeeeeeeeee\
1949 eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\
1950 eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee f\
1951 fffffffffffffffffffffffffffffffffff\
1952 fffffffffffffffffffff ggggggggggggg\
1953 ggggggggggggggggggggggggggggggggggg\
1954 ggggggggggggggggggggggggggggggggggg\
1955 ggggggggggggggggggggggggggggggggggg\
1958 # Three tests for MIME encodign and (a bit) content classification.
1959 # At the same time testing -q FILE, < FILE and -t FILE
1962 < "${BODY}" "${SNAIL}" ${ARGS} ${ADDARG_UNI} \
1963 -a "${BODY}" -s "${SUB}" "${MBOX}"
1964 cksum_test content:001 "${MBOX}" '2356108758 6413'
1967 < /dev/null "${SNAIL}" ${ARGS} ${ADDARG_UNI} \
1968 -a "${BODY}" -s "${SUB}" -q "${BODY}" "${MBOX}"
1969 cksum_test content
:002 "${MBOX}" '2356108758 6413'
1972 ( echo "To: ${MBOX}" && echo "Subject: ${SUB}" && echo &&
1974 ) |
"${SNAIL}" ${ARGS} ${ADDARG_UNI} -Snodot -a "${BODY}" -t
1975 cksum_test content
:003 "${MBOX}" '2356108758 6413'
1977 # Test for [260e19d] (Juergen Daubert)
1979 echo body |
"${SNAIL}" ${ARGS} "${MBOX}"
1980 cksum_test content
:004 "${MBOX}" '4004005686 49'
1982 # Sending of multiple mails in a single invocation
1984 ( printf "m ${MBOX}\n~s subject1\nE-Mail Körper 1\n~.\n" &&
1985 printf "m ${MBOX}\n~s subject2\nEmail body 2\n~.\n" &&
1987 ) |
"${SNAIL}" ${ARGS} ${ADDARG_UNI}
1988 cksum_test content:005 "${MBOX}" '2157252578 260'
1992 # "Test
for" [d6f316a] (Gavin Troy)
1994 printf "m
${MBOX}\n~s subject1
\nEmail body
\n~.
\nfi
${MBOX}\np
\nx
\n" |
1995 "${SNAIL}" ${ARGS} ${ADDARG_UNI} -Spipe-text/plain="${cat}" > "${BODY}"
1996 ${sed} -e 1d < "${BODY}" > "${MBOX}"
1997 cksum_test content
:006 "${MBOX}" '2273863401 83'
1999 # "Test for" [c299c45] (Peter Hofmann) TODO shouldn't end up QP-encoded?
2002 for(i = 0; i < 10000; ++i)
2004 #printf "\xF0\x90\x87\x90"
2005 }' |
"${SNAIL}" ${ARGS} ${ADDARG_UNI} -s TestSubject "${MBOX}"
2006 cksum_test content
:007 "${MBOX}" '1754234717 61767'
2008 ## Test some more corner cases for header bodies (as good as we can today) ##
2012 echo |
"${SNAIL}" ${ARGS} ${ADDARG_UNI} \
2013 -s 'a̲b̲c̲d̲e̲f̲h̲i̲k̲l̲m̲n̲o̲r̲s̲t̲u̲v̲w̲x̲z̲a̲b̲c̲d̲e̲f̲h̲i̲k̲l̲m̲n̲o̲r̲s̲t̲u̲v̲w̲x̲z̲' \
2015 cksum_test content:008 "${MBOX}" '1563381297 326'
2017 # Single word (overlong line split -- bad standard! Requires injection of
2018 # artificial data!! Bad can be prevented by using RFC 2047 encoding)
2020 i=`${awk} 'BEGIN{for(i=0; i<92; ++i) printf "0123456789_
"}'`
2021 echo | "${SNAIL}" ${ARGS} -s "${i}" "${MBOX}"
2022 cksum_test content:009 "${MBOX}" '1996714851 1669'
2024 # Combination of encoded words, space and tabs of varying sort
2026 echo | "${SNAIL}" ${ARGS} ${ADDARG_UNI} \
2027 -s "1Abrä Kaspas1 2Abra Katä b_kaspas2 \
2028 3Abrä Kaspas3 4Abrä Kaspas4 5Abrä Kaspas5 \
2029 6Abra Kaspas6 7Abrä Kaspas7 8Abra Kaspas8 \
2030 9Abra Kaspastäb4-3 10Abra Kaspas1 _ 11Abra Katäb1 \
2031 12Abra Kadabrä1 After Tab after Täb this is NUTS" \
2033 cksum_test content
:010 "${MBOX}" '2956039469 542'
2035 # Overlong multibyte sequence that must be forcefully split
2036 # todo This works even before v15.0, but only by accident
2038 echo |
"${SNAIL}" ${ARGS} ${ADDARG_UNI} \
2039 -s "✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄\
2040 ✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄\
2041 ✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄
" \
2043 cksum_test content:011 "${MBOX}" '454973928 610'
2047 echo | "${SNAIL}" ${ARGS} \
2048 -s "1-1 B2 B3 B4 B5 B6 B\
2049 1-2 B2 B3 B4 B5 B6 B\
2050 1-3 B2 B3 B4 B5 B6 B\
2051 1-4 B2 B3 B4 B5 B6 B\
2052 1-5 B2 B3 B4 B5 B6 B\
2053 1-6 B2 B3 B4 B5 B6
" \
2055 cksum_test content:012 "${MBOX}" '1014122962 248'
2057 # Leading and trailing WS
2059 echo | "${SNAIL}" ${ARGS} \
2060 -s " 2-1 B2 B3 B4 B5 B6 B\
2061 1-2 B2 B3 B4 B5 B6 B\
2062 1-3 B2 B3 B4 B5 B6 B\
2063 1-4 B2 B3 B4 B5 B6
" \
2065 cksum_test content:013 "${MBOX}" '3212167908 187'
2067 # Quick'n dirty RFC 2231 test; i had more when implementing it, but until we
2068 # have a (better) test framework materialize a quick shot
2070 TRAP_EXIT_ADDONS=./.ttt
2072 mkdir ./.ttt || exit 1
2076 : > 'diet\ is \curd.txt'
2077 : > 'diet "is
" curd.txt'
2079 : > höde__tröge__müde__dätte__hätte__vülle__gülle__äse__äße__säuerliche__kräuter__österliche__grüße__mäh.txt
2080 : > höde__tröge__müde__dätte__hätte__vuelle__guelle__aese__aesse__sauerliche__kräuter__österliche__grüße__mäh.txt
2081 : > hööööööööööööööööö_nöööööööööööööööööööööö_düüüüüüüüüüüüüüüüüüü_bäääääääääääääääääääääääh.txt
2082 : > ✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆.txt
2084 echo bla | "${SNAIL}" ${ARGS} ${ADDARG_UNI} \
2085 -a "./.ttt/ma'ger.txt" -a "./.ttt/mä'ger.txt" \
2086 -a './.ttt/diet\ is \curd.txt' -a './.ttt/diet "is" curd.txt' \
2087 -a .
/.ttt
/höde-tröge.txt \
2088 -a .
/.ttt
/höde__tröge__müde__dätte__hätte__vülle__gülle__äse__äße__säuerliche__kräuter__österliche__grüße__mäh.txt \
2089 -a .
/.ttt
/höde__tröge__müde__dätte__hätte__vuelle__guelle__aese__aesse__sauerliche__kräuter__österliche__grüße__mäh.txt \
2090 -a .
/.ttt
/hööööööööööööööööö_nöööööööööööööööööööööö_düüüüüüüüüüüüüüüüüüü_bäääääääääääääääääääääääh.txt \
2091 -a .
/.ttt
/✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆.txt \
2094 cksum_test content
:14 "${MBOX}" '589846634 2491'
2096 printf "Resend ${BODY}\nx\n" | "${SNAIL}" ${ARGS} -f "${MBOX}"
2097 cksum_test content
:14-2 "${MBOX}" '589846634 2491'
2101 if have_feat devel
; then
2102 ARGS
="${ARGS} -Smemdebug"
2109 if [ -z "${CHECK_ONLY}" ]; then
2115 [ ${ESTAT} -eq 0 ] && echo Ok ||
echo >&2 'Errors occurred'