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
39 # Problem: force $SHELL to be a real shell. It seems some testing environments
40 # use nologin(?), but we need a real shell for command execution
41 if { echo ${SHELL} | ${grep} nologin; } >/dev
/null
2>&1; then
42 echo >&2 '$SHELL seems to be nologin, overwriting to /bin/sh!'
47 if [ -z "${UTF8_LOCALE}" ]; then
49 if command -v locale
>/dev
/null
2>&1; then
50 UTF8_LOCALE
=`locale -a | { m=
52 if { echo ${n} | ${grep} -i 'utf-\{0,1\}8'; } >/dev/null 2>&1; then
54 if { echo ${n} | ${grep} -e POSIX -e en_EN -e en_US; }; then
68 echo >&2 "Usage: ./cc-test.sh [--check-only [s-nail-binary]]"
74 [ "${1}" = --check-only ] || usage
75 [ ${#} -gt 2 ] && usage
76 [ ${#} -eq 2 ] && SNAIL
="${2}"
77 [ -x "${SNAIL}" ] || usage
82 trap "${rm} -rf \"${BODY}\" \"${MBOX}\" \${TRAP_EXIT_ADDONS}" EXIT
83 trap "exit 1" HUP INT TERM
86 # Test all configs TODO doesn't cover all *combinations*, stupid!
90 NOTME["OPT_AUTOCC"] = 1
91 NOTME["OPT_DEBUG"] = 1
92 NOTME["OPT_DEVEL"] = 1
93 NOTME["OPT_NOEXTMD5"] = 1
94 NOTME["OPT_NOMEMDBG"] = 1
99 sub(/^[[:space:]]*/, "")
100 # This bails for UnixWare 7.1.4 awk(1), but preceeding = with \
101 # does not seem to be a compliant escape for =
103 $1 = substr($1, 1, index($1, "=") - 1)
109 # Doing this completely sequentially and not doing make distclean in
110 # between runs should effectively result in lesser compilations.
111 # It is completely dumb nonetheless... TODO
112 for (j = 1; j < i; ++j) {
113 for (k = 1; k < j; ++k)
115 for (k = j; k < i; ++k)
117 printf "OPT_AUTOCC=1\n"
119 for (j = 1; j < i; ++j) {
120 for (k = 1; k < j; ++k)
122 for (k = j; k < i; ++k)
124 printf "OPT_AUTOCC=1\n"
127 for (j = 1; j < i; ++j) {
128 for (k = 1; k < j; ++k)
130 for (k = j; k < i; ++k)
132 printf "OPT_AUTOCC=1\n"
133 printf "OPT_DEBUG=1\n"
135 for (j = 1; j < i; ++j) {
136 for (k = 1; k < j; ++k)
138 for (k = j; k < i; ++k)
140 printf "OPT_AUTOCC=1\n"
141 printf "OPT_DEBUG=1\n"
144 printf "CONFIG=NULL OPT_AUTOCC=0\n"
145 printf "CONFIG=NULL OPT_AUTOCC=1\n"
146 printf "CONFIG=NULLI OPT_AUTOCC=0\n"
147 printf "CONFIG=NULLI OPT_AUTOCC=1\n"
148 printf "CONFIG=MINIMAL OPT_AUTOCC=0\n"
149 printf "CONFIG=MINIMAL OPT_AUTOCC=1\n"
150 printf "CONFIG=MEDIUM OPT_AUTOCC=0\n"
151 printf "CONFIG=MEDIUM OPT_AUTOCC=1\n"
152 printf "CONFIG=NETSEND OPT_AUTOCC=0\n"
153 printf "CONFIG=NETSEND OPT_AUTOCC=1\n"
154 printf "CONFIG=MAXIMAL OPT_AUTOCC=0\n"
155 printf "CONFIG=MAXIMAL OPT_AUTOCC=1\n"
156 printf "CONFIG=DEVEL OPT_AUTOCC=0\n"
157 printf "CONFIG=DEVEL OPT_AUTOCC=1\n"
158 printf "CONFIG=ODEVEL OPT_AUTOCC=0\n"
159 printf "CONFIG=ODEVEL OPT_AUTOCC=1\n"
162 printf "\n\n##########\n$c\n"
163 printf "\n\n##########\n$c\n" >&2
171 # Read mailbox $2, strip non-constant headers and MIME boundaries, query the
172 # cksum(1) of the resulting data and compare against the checksum $3
174 tid
=${1} f=${2} s=${3}
176 csum
="`${sed} -e '/^From /d' \
177 -e '/^ boundary=/d' -e '/^--=-=/d' < \"${f}\" \
178 -e '/^\[-- Message/d' | ${cksum}`";
179 if [ "${csum}" = "${s}" ]; then
183 printf 'error: checksum mismatch (got %s)\n' "${csum}"
188 ( "${SNAIL}" ${ARGS} -X'echo $features' -Xx | ${grep} +${1} ) >/dev/null 2>&1
192 # Basic (easily testable) behaviour tests
194 __behave_x_opt_input_command_stack
196 __behave_input_inject_semicolon_seq
200 __behave_macro_param_shift
204 # FIXME __behave_alias
206 # FIXME __behave_mlist
208 have_feat smime && __behave_smime
211 __behave_x_opt_input_command_stack() {
212 ${cat} <<- '__EOT' > "${BODY}"
220 echo "define mac1
{";\
221 echo " echo mac1-1 via1 \
$0";\
223 echo " echo mac1-2
";\
225 echo " echo mac1-3
";\
228 echo "define mac2
{";\
229 echo " echo mac2-1 via1 \
$0";\
231 echo " echo mac2-2
";\
236 echo "wysh
source \"\
237 echo echo 1-1-1 via1 \
$0;\
249 # The -X option supports multiline arguments, and those can internally use
250 # reverse solidus newline escaping. And all -X options are joined...
252 < "${BODY}" "${SNAIL}" ${ARGS} \
266 wysh source '${APO}'\
267 echo "define mac1 {";\
268 echo " echo mac1-1 via2 \$0";\
270 echo " echo mac1-2";\
272 echo " echo mac1-3";\
275 echo "define mac2 {";\
276 echo " echo mac2-1 via2 \$0";\
278 echo " echo mac2-2";\
283 echo "wysh source \"\
284 echo echo 1-1-1 via2 \$0;\
296 ' > "${MBOX}" 2>/dev
/null
341 cksum_test behave
:x_opt_input_command_stack
"${MBOX}" '1391275936 378'
345 ${cat} <<- '__EOT' > "${BODY}"
364 echo 'a${DIET}b${TIED}c\${DIET}d\${TIED}e' # COMMENT
365 echo "a${DIET}b${TIED}c\${DIET}d\${TIED}e"
366 echo $'a${DIET}b${TIED}c\${DIET}d\${TIED}e'
368 echo a$'\101\0101\x41\u0041\u41\U00000041\U41'c
369 echo a$'\u0041\u41\u0C1\U00000041\U41'c
392 echo a$'b\U0000000'dt
393 echo a$'b\U00000000'du
403 if [ -z "${UTF8_LOCALE}" ]; then
404 echo 'Skip behave:wysh_unicode, no UTF8_LOCALE'
406 < "${BODY}" DIET=CURD TIED= \
407 LC_ALL=${UTF8_LOCALE} "${SNAIL}" ${ARGS} 2>/dev/null > "${MBOX}"
423 #a${DIET}b${TIED}c\${DIET}d\${TIED}e
424 #aCURDbc${DIET}d${TIED}e
425 #a${DIET}b${TIED}cCURDde
454 cksum_test behave:wysh_unicode "${MBOX}" '475805847 317'
457 < "${BODY}" DIET=CURD TIED= "${SNAIL}" ${ARGS} > "${MBOX}" 2>/dev/null
473 #a${DIET}b${TIED}c\${DIET}d\${TIED}e
474 #aCURDbc${DIET}d${TIED}e
475 #a${DIET}b${TIED}cCURDde
504 cksum_test behave:wysh_c "${MBOX}" '1473887148 321'
507 __behave_input_inject_semicolon_seq() {
508 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} > "${MBOX}"
513 echon this_is_mymac;call mydeepmac;echon ';';
515 echon one';';~mymac;echon two";";call mymac;echo three$';';
517 echon this_is_mymac;call mydeepmac;echon ,TOO'!;';
519 echon one';';~mymac;echon two";";call mymac;echo three$';';
521 #one;this_is_mymac(mydeepmac);two;this_is_mymac(mydeepmac);three;
522 #one;this_is_mymac(mydeepmac),TOO!;two;this_is_mymac(mydeepmac),TOO!;three;
523 cksum_test behave:input_inject_semicolon_seq "${MBOX}" '512117110 140'
527 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} > "${MBOX}"
535 ghost XxXxXx echo huhu
536 ghost XxXxXxX echo huhu
544 cksum_test behave:ghost "${MBOX}" '776950759 26'
549 # Nestable conditions test
550 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} > "${MBOX}"
572 if $dietcurd == 'yoho'
577 if $dietcurd != 'yoho'
638 if $dietcurd == 'yohu'
640 elif $dietcurd == 'yoha'
642 elif $dietcurd == 'yohe'
644 elif $dietcurd == 'yoho'
646 if $dietcurd == 'yohu'
648 elif $dietcurd == 'yoha'
650 elif $dietcurd == 'yohe'
652 elif $dietcurd == 'yoho'
654 if $dietcurd == 'yohu'
656 elif $dietcurd == 'yoha'
658 elif $dietcurd == 'yohe'
660 elif $dietcurd == 'yoho'
671 # integer conversion, <..>..
774 set diet=abc curd=abc
780 set diet=abc curd=abcd
786 # 1. Shitty grouping capabilities as of today
787 unset diet curd ndefined
788 if [ [ false ] || [ false ] || [ true ] ] && [ [ false ] || [ true ] ] && \
794 if [ [ [ [ 0 ] || [ 1 ] ] && [ [ 1 ] || [ 0 ] ] ] && [ 1 ] ] && [ yes ]
799 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] ]
804 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] ]
809 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] || [ 1 ] ] && [ no ]
814 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] || [ 1 ] ] \
820 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 1 ] ]
825 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 0 ] ]
830 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 0 ] ] && [ 1 ] ] ] && [ 1 ] ]
835 if [ [ [ [ [ [ [ 0 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 1 ] ]
840 if [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] && [ 0 ]
845 if [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] && [ 1 ]
850 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ]
855 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 1 ]
860 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ] || [ 1 ] && [ 0 ]
865 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ] || [ 1 ] && [ 1 ]
871 if [ [ $diet == 'yo' ] && [ $curd == 'ho' ] ] && [ $ndefined ]
877 if [ [ $diet == 'yo' ] && [ $curd == 'ho' ] ] && [ $ndefined ]
882 # 2. Shitty grouping capabilities as of today
883 unset diet curd ndefined
884 if [ false || false || true ] && [ false || true ] && yes
889 if [ [ [ 0 || 1 ] && [ 1 || 0 ] ] && 1 ] && [ yes ]
894 if [ 1 || 0 || 0 || 0 ]
899 if [ 1 || 0 || 0 || 0 || [ 1 ] ]
904 if [ 1 || 0 || 0 || 0 || [ 1 ] || 1 ] && no
909 if [ 1 || 0 || 0 || 0 || 1 || [ 1 ] ] && no || [ yes ]
914 if [ [ [ [ [ [ 1 ] && 1 ] && 1 ] && 1 ] ] && [ 1 ] ]
919 if [ [ [ [ [ [ 1 ] && 1 ] && 1 ] && [ 1 ] ] ] && 0 ]
924 if [ [ [ [ [ [ [ 1 ] ] && 1 ] && 0 ] && [ 1 ] ] ] && 1 ]
929 if [ [ [ [ [ [ 0 ] && 1 ] && 1 ] && 1 ] ] && 1 ]
934 if 1 || 0 || 0 || 0 && 0
939 if 1 || 0 || 0 || 0 && 1
944 if 0 || 0 || 0 || 1 && 0
949 if 0 || 0 || 0 || 1 && 1
954 if 0 || 0 || 0 || 1 && 0 || 1 && 0
959 if 0 || 0 || 0 || 1 && 0 || 1 && 1
965 if [ $diet == 'yo' && $curd == 'ho' ] && $ndefined
970 if $diet == 'yo' && $curd == 'ho' && $ndefined
976 if [ $diet == 'yo' && $curd == 'ho' ] && $ndefined
981 if $diet == 'yo' && $curd == 'ho' && $ndefined
986 if [ [ [ [ [ [ $diet == 'yo' && $curd == 'ho' && $ndefined ] ] ] ] ] ]
991 # Some more en-braced variables
993 if ${diet} == ${curd}
998 if ${diet} != ${curd}
1014 if ! 0 && ! ! 1 && ! ! ! ! 2 && 3
1019 if ! 0 && ! [ ! 1 ] && ! [ ! [ ! [ ! 2 ] ] ] && 3
1024 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
1029 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && ! 3
1034 if [ ! 0 ] && [ ! [ ! 1 ] ] && ! [ [ ! [ ! [ ! [ 2 ] ] ] ] ] && ! 3
1039 if [ ! 0 ] && ! [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
1044 if ! [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
1049 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] || 3
1054 if [ ! 0 ] && [ ! ! [ ! ! 1 ] ] && [ ! ! [ ! ! [ ! ! [ ! ! [ 2 ] ] ] ] ]
1060 if ! 0 && ! ! 1 && ! ! ! 0 && 3
1065 if ! 0 && ! [ ! 1 ] && ! [ ! [ ! [ 0 ] ] ] && 3
1070 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ [ 0 ] ] ] ] ] && 3
1075 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! ! [ ! [ ! 0 ] ] ] ] && ! 3
1080 if [ ! 0 ] && [ ! [ ! 1 ] ] && ! [ ! [ ! [ ! [ ! 0 ] ] ] ] && 3
1085 if [ ! 0 ] && ! [ ! [ ! 1 ] ] && [ ! ! [ ! [ ! [ ! [ 0 ] ] ] ] ] && 3
1090 if ! [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! ! 0 ] ] ] ] && 3
1095 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ ! 0 ] ] ] ] ] || 3
1100 if [ ! 0 ] && [ ! ! [ ! ! 1 ] ] && [ ! ! [ ! ! [ ! ! [ ! [ 0 ] ] ] ] ]
1106 cksum_test behave:if-normal "${MBOX}" '557629289 631'
1108 if have_feat regex; then
1109 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} > "${MBOX}"
1111 if $dietcurd =~ '^yo.*'
1116 if $dietcurd =~ '^yoho.+'
1121 if $dietcurd !~ '.*ho$'
1126 if $dietcurd !~ '.+yoho$'
1131 if [ $dietcurd !~ '.+yoho$' ]
1136 if ! [ $dietcurd =~ '.+yoho$' ]
1141 if ! ! [ $dietcurd !~ '.+yoho$' ]
1146 if ! [ ! [ $dietcurd !~ '.+yoho$' ] ]
1151 if [ ! [ ! [ $dietcurd !~ '.+yoho$' ] ] ]
1156 if ! [ ! [ ! [ $dietcurd !~ '.+yoho$' ] ] ]
1161 if ! ! ! $dietcurd !~ '.+yoho$'
1166 if ! ! ! $dietcurd =~ '.+yoho$'
1171 if ! [ ! ! [ ! [ $dietcurd !~ '.+yoho$' ] ] ]
1176 set diet=abc curd='^abc$'
1182 set diet=abc curd='^abcd$'
1189 cksum_test behave:if-regex "${MBOX}" '439960016 81'
1193 __behave_localopts() {
1194 # Nestable conditions test
1195 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} > "${MBOX}"
1210 echo $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2
1215 echo $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2
1216 echo "$gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2"
1225 echo active trouble: $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t3
1227 echo active null: $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t3
1233 #gv1 lv1 lv2 lv3 gv2, t2
1241 #gv1 lv1 lv2 lv3 gv2, t2
1244 #active trouble: gv1 gv2,
1246 cksum_test behave:localopts "${MBOX}" '1936527193 192'
1249 __behave_macro_param_shift() {
1250 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} > "${MBOX}" 2>/dev/null
1253 echo t2.0 has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1258 echo t2.1 has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1259 if [ $# > 1 ] || [ $ignerr == '' ]
1264 echo t2.2:$? has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1266 echo t2.3:$? has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1270 echo t2.4:$? has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1274 call t2 1 you get four args
1275 echo t1.1: $?';' ignerr ($ignerr) should not exist
1276 call t2 1 you get 'three args'
1277 echo t1.2: $?';' ignerr ($ignerr) should not exist
1278 call t2 1 you 'get two args'
1279 echo t1.3: $?';' ignerr ($ignerr) should not exist
1280 call t2 1 'you get one arg'
1281 echo t1.4: $?';' ignerr ($ignerr) should not exist
1282 ignerr call t2 '' 'you get one arg'
1283 echo t1.5: $?';' ignerr ($ignerr) should not exist
1289 #t2.0 has 5/5 parameters: 1,you,get (1 you get four args) [1 you get four args]
1290 #t2.1 has 4/4 parameters: you,get,four (you get four args) [you get four args]
1291 #t2.2:0 has 2/2 parameters: four,args, (four args) [four args]
1292 #t2.3:0 has 2/2 parameters: four,args, (four args) [four args]
1293 #t2.4:0 has 1/1 parameters: args,, (args) [args]
1294 #t1.1: 0; ignerr () should not exist
1296 #t2.0 has 4/4 parameters: 1,you,get (1 you get three args) [1 you get three args]
1297 #t2.1 has 3/3 parameters: you,get,three args (you get three args) [you get three args]
1298 #t2.2:0 has 1/1 parameters: three args,, (three args) [three args]
1299 #t2.3:0 has 1/1 parameters: three args,, (three args) [three args]
1300 #t2.4:0 has 0/0 parameters: ,, () []
1301 #t1.2: 0; ignerr () should not exist
1303 #t2.0 has 3/3 parameters: 1,you,get two args (1 you get two args) [1 you get two args]
1304 #t2.1 has 2/2 parameters: you,get two args, (you get two args) [you get two args]
1305 #t2.2:0 has 0/0 parameters: ,, () []
1306 #t2.3:0 has 0/0 parameters: ,, () []
1307 #t2.4:0 has 0/0 parameters: ,, () []
1308 #t1.3: 0; ignerr () should not exist
1310 #t2.0 has 2/2 parameters: 1,you get one arg, (1 you get one arg) [1 you get one arg]
1311 #t2.1 has 1/1 parameters: you get one arg,, (you get one arg) [you get one arg]
1312 #t2.2:0 has 1/1 parameters: you get one arg,, (you get one arg) [you get one arg]
1313 #t2.3:0 has 1/1 parameters: you get one arg,, (you get one arg) [you get one arg]
1314 #t2.4:0 has 0/0 parameters: ,, () []
1315 #t1.4: 0; ignerr () should not exist
1317 #t2.0 has 2/2 parameters: ,you get one arg, ( you get one arg) [ you get one arg]
1318 #t2.1 has 1/1 parameters: you get one arg,, (you get one arg) [you get one arg]
1319 #t1.5: 1; ignerr () should not exist
1320 cksum_test behave:macro_param_shift "${MBOX}" '1402489146 1682'
1323 __behave_addrcodec() {
1324 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} > "${MBOX}" 2>/dev/null
1325 vput addrcodec res 1 <doog@def>
1327 vput addrcodec res 2 . <doog@def>
1329 vput addrcodec res 3 Sauer Dr. <doog@def>
1331 vput addrcodec res 4 Sauer (Ma) Dr. <doog@def>
1333 vput addrcodec res 5 Sauer (Ma) Braten Dr. <doog@def>
1335 vput addrcodec res 6 Sauer (Ma) Braten Dr. (Heu) <doog@def>
1337 vput addrcodec res 7 Sauer (Ma) Braten Dr. (Heu) <doog@def> (bu)
1339 vput addrcodec res 8 \
1340 Dr. Sauer (Ma) Braten Dr. (Heu) <doog@def> (bu) Boom. Boom
1342 vput addrcodec res 9 Dr.Sauer(Ma)Braten Dr. (Heu) <doog@def>
1344 vput addrcodec res 10 (Ma)Braten Dr. (Heu) <doog@def>
1346 vput addrcodec res 11 (Ma)Braten Dr'"."' (Heu) <doog@def>
1348 vput addrcodec res 12 \
1349 ' Dr. ' ' Sauer ' (Ma) ' Braten ' ' Dr. ' (u) <doog@def>
1351 vput addrcodec res 13(Ma)Braten Dr. (Heu) <doog@def>
1353 vput addrcodec res 14 Hey, Du <doog@def> Wie() findet Dr. das? ()
1355 vput addrcodec res 15 \
1356 Hey, Du <doog@def> Wie() findet '""' Dr. '""' das? ()
1358 vput addrcodec res 16 \
1359 \"Hey,\" \"Du\" <doog@def> \"Wie()\" findet \"\" Dr. \"\" das? ()
1361 vput addrcodec res 17 \
1362 \"Hey\" Du <doog@def> \"Wie() findet \" \" Dr. \"\"\" das? ()
1364 vput addrcodec res 18 \
1365 <doog@def> \"Hey\" Du \"Wie() findet \" \" Dr. \"\"\" das? ()
1367 vput addrcodec res 19 \
1368 'Hey\,\" ' <doog@def> '"Wie()" findet \" Dr. \"' das? ()
1373 #0 "3 Sauer Dr." <doog@def>
1374 #0 4 Sauer (Ma) "Dr." <doog@def>
1375 #0 5 Sauer (Ma) "Braten Dr." <doog@def>
1376 #0 6 Sauer (Ma) "Braten Dr." (Heu) <doog@def>
1377 #0 7 Sauer (Ma) "Braten Dr." (Heu bu) <doog@def>
1378 #0 "8 Dr. Sauer" (Ma) "Braten Dr." (Heu bu) "Boom. Boom" <doog@def>
1379 #0 "9 Dr.Sauer" (Ma) "Braten Dr." (Heu) <doog@def>
1380 #0 10 (Ma) "Braten Dr." (Heu) <doog@def>
1381 #0 11 (Ma) "Braten Dr\".\"" (Heu) <doog@def>
1382 #0 "12 Dr. Sauer" (Ma) "Braten Dr." (u) <doog@def>
1383 #0 13 (Ma) "Braten Dr." (Heu) <doog@def>
1384 #0 "14 Hey, Du Wie" () "findet Dr. das?" () <doog@def>
1385 #0 "15 Hey, Du Wie" () "findet \"\" Dr. \"\" das?" () <doog@def>
1386 #0 "16 \"Hey,\" \"Du\" \"Wie" () "\" findet \"\" Dr. \"\" das?" () <doog@def>
1387 #0 "17 \"Hey\" Du \"Wie" () "findet \" \" Dr. \"\"\" das?" () <doog@def>
1388 #0 "18 \"Hey\" Du \"Wie" () "findet \" \" Dr. \"\"\" das?" () <doog@def>
1389 #0 "19 Hey\\,\\\" \"Wie" () "\" findet \\\" Dr. \\\" das?" () <doog@def>
1390 cksum_test behave:addrcodec "${MBOX}" '1997352922 927'
1394 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} > "${MBOX}" 2>/dev/null
1395 vput vexpr res = 9223372036854775807
1397 vput vexpr res = 9223372036854775808
1399 vput vexpr res =@ 9223372036854775808
1401 vput vexpr res = -9223372036854775808
1403 vput vexpr res = -9223372036854775809
1405 vput vexpr res =@ -9223372036854775809
1415 vput vexpr res + 0 0
1417 vput vexpr res + 0 1
1419 vput vexpr res + 1 1
1422 vput vexpr res + 9223372036854775807 0
1424 vput vexpr res + 9223372036854775807 1
1426 vput vexpr res +@ 9223372036854775807 1
1428 vput vexpr res + 0 9223372036854775807
1430 vput vexpr res + 1 9223372036854775807
1432 vput vexpr res +@ 1 9223372036854775807
1435 vput vexpr res + -9223372036854775808 0
1437 vput vexpr res + -9223372036854775808 -1
1439 vput vexpr res +@ -9223372036854775808 -1
1441 vput vexpr res + 0 -9223372036854775808
1443 vput vexpr res + -1 -9223372036854775808
1445 vput vexpr res +@ -1 -9223372036854775808
1448 vput vexpr res - 0 0
1450 vput vexpr res
- 0 1
1452 vput vexpr res
- 1 1
1455 vput vexpr res
- 9223372036854775807 0
1457 vput vexpr res
- 9223372036854775807 -1
1459 vput vexpr res
-@
9223372036854775807 -1
1461 vput vexpr res
- 0 9223372036854775807
1463 vput vexpr res
- -1 9223372036854775807
1465 vput vexpr res
- -2 9223372036854775807
1467 vput vexpr res
-@
-2 9223372036854775807
1470 vput vexpr res
- -9223372036854775808 +0
1472 vput vexpr res
- -9223372036854775808 +1
1474 vput vexpr res
-@
-9223372036854775808 +1
1476 vput vexpr res
- 0 -9223372036854775808
1478 vput vexpr res
- +1 -9223372036854775808
1480 vput vexpr res
-@
+1 -9223372036854775808
1483 vput vexpr res
+ -13 -2
1485 vput vexpr res
- 0 0
1487 vput vexpr res
- 0 1
1489 vput vexpr res
- 1 1
1491 vput vexpr res
- -13 -2
1494 vput vexpr res
* 0 0
1496 vput vexpr res
* 0 1
1498 vput vexpr res
* 1 1
1500 vput vexpr res
* -13 -2
1503 vput vexpr res
/ 0 0
1505 vput vexpr res
/ 0 1
1507 vput vexpr res
/ 1 1
1509 vput vexpr res
/ -13 -2
1512 vput vexpr res
% 0 0
1514 vput vexpr res
% 0 1
1516 vput vexpr res
% 1 1
1518 vput vexpr res
% -13 -2
1521 #0 9223372036854775807
1523 #1 9223372036854775807
1524 #0 -9223372036854775808
1526 #1 -9223372036854775808
1536 #0 9223372036854775807
1538 #1 9223372036854775807
1539 #0 9223372036854775807
1541 #1 9223372036854775807
1543 #0 -9223372036854775808
1545 #1 -9223372036854775808
1546 #0 -9223372036854775808
1548 #1 -9223372036854775808
1554 #0 9223372036854775807
1556 #1 9223372036854775807
1557 #0 -9223372036854775807
1558 #0 -9223372036854775808
1560 #1 -9223372036854775808
1562 #0 -9223372036854775808
1564 #1 -9223372036854775808
1565 #0 -9223372036854775808
1567 #1 -9223372036854775808
1589 cksum_test behave
:vexpr-numeric
"${MBOX}" '2147139513 687'
1591 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} > "${MBOX}" #2>/dev/null
1592 vput vexpr res find 'bananarama' 'nana'
1594 vput vexpr res find 'bananarama' 'bana'
1596 vput vexpr res find 'bananarama' 'Bana'
1598 vput vexpr res find 'bananarama' 'rama'
1601 vput vexpr res ifind 'bananarama' 'nana'
1603 vput vexpr res ifind 'bananarama' 'bana'
1605 vput vexpr res ifind 'bananarama' 'Bana'
1607 vput vexpr res ifind 'bananarama' 'rama'
1610 vput vexpr res substring 'bananarama' 1
1612 vput vexpr res substring 'bananarama' 3
1614 vput vexpr res substring 'bananarama' 5
1616 vput vexpr res substring 'bananarama' 7
1618 vput vexpr res substring 'bananarama' 9
1620 vput vexpr res substring 'bananarama' 10
1622 vput vexpr res substring 'bananarama' 1 3
1624 vput vexpr res substring 'bananarama' 3 3
1626 vput vexpr res substring 'bananarama' 5 3
1628 vput vexpr res substring 'bananarama' 7 3
1630 vput vexpr res substring 'bananarama' 9 3
1632 vput vexpr res substring 'bananarama' 10 3
1659 cksum_test behave:vexpr-string "${MBOX}" '2171181036 119'
1661 if have_feat regex; then
1662 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} > "${MBOX}" #2>/dev/null
1663 vput vexpr res regex
'bananarama' 'nana'
1665 vput vexpr res regex
'bananarama' 'bana'
1667 vput vexpr res regex
'bananarama' 'Bana'
1669 vput vexpr res regex
'bananarama' 'rama'
1672 vput vexpr res iregex
'bananarama' 'nana'
1674 vput vexpr res iregex
'bananarama' 'bana'
1676 vput vexpr res iregex
'bananarama' 'Bana'
1678 vput vexpr res iregex
'bananarama' 'rama'
1681 vput vexpr res regex
'bananarama' '(.*)nana(.*)' '\${1}a\${0}u{\$2}'
1683 vput vexpr res regex
'bananarama' '(.*)bana(.*)' '\${1}a\${0}u\$2'
1685 vput vexpr res regex
'bananarama' 'Bana(.+)' '\$1\$0'
1687 vput vexpr res regex
'bananarama' '(.+)rama' '\$1\$0'
1690 vput vexpr res iregex
'bananarama' '(.*)nana(.*)' '\${1}a\${0}u{\$2}'
1692 vput vexpr res iregex
'bananarama' '(.*)bana(.*)' '\${1}a\${0}u\$2'
1694 vput vexpr res iregex
'bananarama' 'Bana(.+)' '\$1\$0'
1696 vput vexpr res iregex
'bananarama' '(.+)rama' '\$1\$0'
1710 #0 baabananaramau{rama}
1711 #0 abananaramaunarama
1715 #0 baabananaramau{rama}
1716 #0 abananaramaunarama
1720 cksum_test behave
:vexpr-regex
"${MBOX}" '3419299180 199'
1724 __behave_smime
() { # FIXME add test/ dir, unroll tests therein
1725 TRAP_EXIT_ADDONS
="./.t.conf ./.tkey.pem ./.tcert.pem ./.tpair.pem"
1726 TRAP_EXIT_ADDONS
="${TRAP_EXIT_ADDONS} ./.VERIFY ./.DECRYPT ./.ENCRYPT"
1727 TRAP_EXIT_ADDONS
="${TRAP_EXIT_ADDONS} ./.tsendmail.sh"
1729 printf 'behave:s/mime: .. generating test key and certificate ..\n'
1730 ${cat} <<-_EOT > ./.t.conf
1733 default_keyfile = keyfile.pem
1734 distinguished_name = req_distinguished_name
1735 attributes = req_attributes
1739 [ req_distinguished_name ]
1746 emailAddress = test@localhost
1751 openssl req
-x509 -nodes -days 3650 -config .
/.t.conf \
1752 -newkey rsa
:1024 -keyout .
/.tkey.pem
-out .
/.tcert.pem
>/dev
/null
2>&1
1753 ${cat} .
/.tkey.pem .
/.tcert.pem
> .
/.tpair.pem
1755 printf "behave:s/mime:sign/verify: "
1756 echo bla |
"${SNAIL}" ${ARGS} \
1757 -Ssmime-ca-file=.
/.tcert.pem
-Ssmime-sign-cert=.
/.tpair.pem \
1758 -Ssmime-sign -Sfrom=test@localhost \
1759 -s 'S/MIME test' .
/.VERIFY
1760 printf 'verify\nx\n' |
1761 "${SNAIL}" ${ARGS} \
1762 -Ssmime-ca-file=.
/.tcert.pem
-Ssmime-sign-cert=.
/.tpair.pem \
1763 -Ssmime-sign -Sfrom=test@localhost \
1764 -Sbatch-exit-on-error -R \
1765 -f .
/.VERIFY
>/dev
/null
2>&1
1766 if [ $?
-eq 0 ]; then
1769 printf 'error: verification failed\n'
1771 ${rm} -f ${TRAP_EXIT_ADDONS}
1775 printf ' .. disproof via openssl smime(1): '
1776 if openssl smime
-verify -CAfile .
/.tcert.pem \
1777 -in .
/.VERIFY
>/dev
/null
2>&1; then
1782 ${rm} -f ${TRAP_EXIT_ADDONS}
1787 # (signing +) encryption / decryption
1788 ${cat} <<-_EOT > ./.tsendmail.sh
1791 (echo 'From S-Postman Thu May 10 20:40:54 2012' && ${cat}) > ./.ENCRYPT
1793 chmod 0755 .
/.tsendmail.sh
1795 printf "behave:s/mime:encrypt+sign/decrypt+verify: "
1797 "${SNAIL}" ${ARGS} \
1798 -Ssmime-force-encryption \
1799 -Ssmime-encrypt-recei@ver.com
=.
/.tpair.pem \
1800 -Smta=.
/.tsendmail.sh \
1801 -Ssmime-ca-file=.
/.tcert.pem
-Ssmime-sign-cert=.
/.tpair.pem \
1802 -Ssmime-sign -Sfrom=test@localhost \
1803 -s 'S/MIME test' recei@ver.com
1805 printf 'decrypt ./.DECRYPT\nfi ./.DECRYPT\nverify\nx\n' |
1806 "${SNAIL}" ${ARGS} \
1807 -Ssmime-force-encryption \
1808 -Ssmime-encrypt-recei@ver.com
=.
/.tpair.pem \
1809 -Smta=.
/.tsendmail.sh \
1810 -Ssmime-ca-file=.
/.tcert.pem
-Ssmime-sign-cert=.
/.tpair.pem \
1811 -Ssmime-sign -Sfrom=test@localhost \
1812 -Sbatch-exit-on-error -R \
1813 -f .
/.ENCRYPT
>/dev
/null
2>&1
1814 if [ $?
-eq 0 ]; then
1818 printf 'error: decryption+verification failed\n'
1820 printf ' ..disproof via openssl smime(1): '
1821 if (openssl smime
-decrypt -inkey .
/.tkey.pem
-in .
/.ENCRYPT |
1822 openssl smime
-verify -CAfile .
/.tcert.pem
) >/dev
/null
2>&1; then
1828 ${sed} -e '/^Date:/d' -e '/^X-Decoding-Date/d' \
1830 '/^Content-Disposition: attachment; filename="smime.p7s"/,/^-- /d' \
1831 < .
/.DECRYPT
> .
/.ENCRYPT
1832 cksum_test
".. checksum of decrypted content" "./.ENCRYPT" '3090916509 510'
1834 printf "behave:s/mime:encrypt/decrypt: "
1836 echo bla |
"${SNAIL}" ${ARGS} \
1837 -Ssmime-force-encryption \
1838 -Ssmime-encrypt-recei@ver.com
=.
/.tpair.pem \
1839 -Smta=.
/.tsendmail.sh \
1840 -Ssmime-ca-file=.
/.tcert.pem
-Ssmime-sign-cert=.
/.tpair.pem \
1841 -Sfrom=test@localhost \
1842 -s 'S/MIME test' recei@ver.com
1843 printf 'decrypt ./.DECRYPT\nx\n' |
"${SNAIL}" ${ARGS} \
1844 -Ssmime-force-encryption \
1845 -Ssmime-encrypt-recei@ver.com
=.
/.tpair.pem \
1846 -Smta=.
/.tsendmail.sh \
1847 -Ssmime-ca-file=.
/.tcert.pem
-Ssmime-sign-cert=.
/.tpair.pem \
1848 -Sfrom=test@localhost \
1849 -Sbatch-exit-on-error -R \
1850 -f .
/.ENCRYPT
>/dev
/null
2>&1
1851 if [ $?
-eq 0 ]; then
1855 printf 'error: decryption failed\n'
1857 printf '.. disproof via openssl smime(1): '
1858 if openssl smime
-decrypt -inkey .
/.tkey.pem \
1859 -in .
/.ENCRYPT
>/dev
/null
2>&1; then
1865 ${sed} -e '/^Date:/d' -e '/^X-Decoding-Date/d' \
1866 < .
/.DECRYPT
> .
/.ENCRYPT
1867 cksum_test
".. checksum of decrypted content" .
/.ENCRYPT
'999887248 295'
1869 ${rm} -f ${TRAP_EXIT_ADDONS}
1874 # Some basic tests regarding correct sending of mails, via STDIN / -t / -q,
1875 # including basic MIME Content-Transfer-Encoding correctness (quoted-printable)
1876 # Note we unfortunately need to place some statements without proper
1877 # indentation because of continuation problems
1879 # MIME encoding (QP) stress message body
1881 'Ich bin eine DÖS-Datäi mit sehr langen Zeilen und auch '\
1882 'sonst bin ich ganz schön am Schleudern, da kannste denke '\
1883 "wasde willst, gelle, gelle, gelle, gelle, gelle.\r\n"\
1884 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst \r\n"\
1885 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 1\r\n"\
1886 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 12\r\n"\
1887 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 123\r\n"\
1888 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 1234\r\n"\
1889 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 12345\r\n"\
1890 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 123456\r\n"\
1891 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 1234567\r\n"\
1892 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 12345678\r\n"\
1893 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 123456789\r\n"\
1894 "Unn ausserdem habe ich trailing SP/HT/SP/HT whitespace \r\n"\
1895 "Unn ausserdem habe ich trailing HT/SP/HT/SP whitespace \r\n"\
1896 "auf den zeilen vorher.\r\n"\
1897 "From am Zeilenbeginn und From der Mitte gibt es auch.\r\n"\
1899 "Die letzte Zeile war nur ein Punkt.\r\n"\
1901 "Das waren deren zwei.\r\n"\
1903 "Die letzte Zeile war ein Leerschritt.\n"\
1904 "=VIER = EQUAL SIGNS=ON A LINE=\r\n"\
1907 "Die letzte Zeile war nur ein Punkt, mit Unix Zeilenende.\n"\
1909 "Das waren deren zwei. ditto.\n"\
1911 "Unn ausseerdem habe ich trailing SP/HT/SP/HT whitespace \n"\
1912 "Unn ausseerdem habe ich trailing HT/SP/HT/SP whitespace \n"\
1913 "auf den zeilen vorher.\n"\
1915 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.\n"\
1916 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.1"\
1918 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
1920 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
1922 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
1924 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
1926 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
1928 "QP am Zeilenende über soft-nl hinweg\n"\
1929 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende."\
1931 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende."\
1933 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende."\
1935 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende."\
1937 "=VIER = EQUAL SIGNS=ON A LINE=\n"\
1939 "Die letzte Zeile war ein Leerschritt.\n"\
1943 # MIME encoding (QP) stress message subject
1944 SUB
="Äbrä Kä?dä=brö Fü?di=bus? \
1945 adadaddsssssssddddddddddddddddddddd\
1946 ddddddddddddddddddddddddddddddddddd\
1947 ddddddddddddddddddddddddddddddddddd\
1948 dddddddddddddddddddd Hallelulja? Od\
1949 er?? eeeeeeeeeeeeeeeeeeeeeeeeeeeeee\
1950 eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\
1951 eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee f\
1952 fffffffffffffffffffffffffffffffffff\
1953 fffffffffffffffffffff ggggggggggggg\
1954 ggggggggggggggggggggggggggggggggggg\
1955 ggggggggggggggggggggggggggggggggggg\
1956 ggggggggggggggggggggggggggggggggggg\
1959 # Three tests for MIME encodign and (a bit) content classification.
1960 # At the same time testing -q FILE, < FILE and -t FILE
1963 < "${BODY}" "${SNAIL}" ${ARGS} ${ADDARG_UNI} \
1964 -a "${BODY}" -s "${SUB}" "${MBOX}"
1965 cksum_test content:001 "${MBOX}" '2356108758 6413'
1968 < /dev/null "${SNAIL}" ${ARGS} ${ADDARG_UNI} \
1969 -a "${BODY}" -s "${SUB}" -q "${BODY}" "${MBOX}"
1970 cksum_test content
:002 "${MBOX}" '2356108758 6413'
1973 ( echo "To: ${MBOX}" && echo "Subject: ${SUB}" && echo &&
1975 ) |
"${SNAIL}" ${ARGS} ${ADDARG_UNI} -Snodot -a "${BODY}" -t
1976 cksum_test content
:003 "${MBOX}" '2356108758 6413'
1978 # Test for [260e19d] (Juergen Daubert)
1980 echo body |
"${SNAIL}" ${ARGS} "${MBOX}"
1981 cksum_test content
:004 "${MBOX}" '4004005686 49'
1983 # Sending of multiple mails in a single invocation
1985 ( printf "m ${MBOX}\n~s subject1\nE-Mail Körper 1\n~.\n" &&
1986 printf "m ${MBOX}\n~s subject2\nEmail body 2\n~.\n" &&
1988 ) |
"${SNAIL}" ${ARGS} ${ADDARG_UNI}
1989 cksum_test content:005 "${MBOX}" '2157252578 260'
1993 # "Test
for" [d6f316a] (Gavin Troy)
1995 printf "m
${MBOX}\n~s subject1
\nEmail body
\n~.
\nfi
${MBOX}\np
\nx
\n" |
1996 "${SNAIL}" ${ARGS} ${ADDARG_UNI} -Spipe-text/plain="${cat}" > "${BODY}"
1997 ${sed} -e 1d < "${BODY}" > "${MBOX}"
1998 cksum_test content
:006 "${MBOX}" '2273863401 83'
2000 # "Test for" [c299c45] (Peter Hofmann) TODO shouldn't end up QP-encoded?
2003 for(i = 0; i < 10000; ++i)
2005 #printf "\xF0\x90\x87\x90"
2006 }' |
"${SNAIL}" ${ARGS} ${ADDARG_UNI} -s TestSubject "${MBOX}"
2007 cksum_test content
:007 "${MBOX}" '1754234717 61767'
2009 ## Test some more corner cases for header bodies (as good as we can today) ##
2013 echo |
"${SNAIL}" ${ARGS} ${ADDARG_UNI} \
2014 -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̲' \
2016 cksum_test content:008 "${MBOX}" '1563381297 326'
2018 # Single word (overlong line split -- bad standard! Requires injection of
2019 # artificial data!! Bad can be prevented by using RFC 2047 encoding)
2021 i=`${awk} 'BEGIN{for(i=0; i<92; ++i) printf "0123456789_
"}'`
2022 echo | "${SNAIL}" ${ARGS} -s "${i}" "${MBOX}"
2023 cksum_test content:009 "${MBOX}" '1996714851 1669'
2025 # Combination of encoded words, space and tabs of varying sort
2027 echo | "${SNAIL}" ${ARGS} ${ADDARG_UNI} \
2028 -s "1Abrä Kaspas1 2Abra Katä b_kaspas2 \
2029 3Abrä Kaspas3 4Abrä Kaspas4 5Abrä Kaspas5 \
2030 6Abra Kaspas6 7Abrä Kaspas7 8Abra Kaspas8 \
2031 9Abra Kaspastäb4-3 10Abra Kaspas1 _ 11Abra Katäb1 \
2032 12Abra Kadabrä1 After Tab after Täb this is NUTS" \
2034 cksum_test content
:010 "${MBOX}" '2956039469 542'
2036 # Overlong multibyte sequence that must be forcefully split
2037 # todo This works even before v15.0, but only by accident
2039 echo |
"${SNAIL}" ${ARGS} ${ADDARG_UNI} \
2040 -s "✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄\
2041 ✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄\
2042 ✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄
" \
2044 cksum_test content:011 "${MBOX}" '454973928 610'
2048 echo | "${SNAIL}" ${ARGS} \
2049 -s "1-1 B2 B3 B4 B5 B6 B\
2050 1-2 B2 B3 B4 B5 B6 B\
2051 1-3 B2 B3 B4 B5 B6 B\
2052 1-4 B2 B3 B4 B5 B6 B\
2053 1-5 B2 B3 B4 B5 B6 B\
2054 1-6 B2 B3 B4 B5 B6
" \
2056 cksum_test content:012 "${MBOX}" '1014122962 248'
2058 # Leading and trailing WS
2060 echo | "${SNAIL}" ${ARGS} \
2061 -s " 2-1 B2 B3 B4 B5 B6 B\
2062 1-2 B2 B3 B4 B5 B6 B\
2063 1-3 B2 B3 B4 B5 B6 B\
2064 1-4 B2 B3 B4 B5 B6
" \
2066 cksum_test content:013 "${MBOX}" '3212167908 187'
2068 # Quick'n dirty RFC 2231 test; i had more when implementing it, but until we
2069 # have a (better) test framework materialize a quick shot
2071 TRAP_EXIT_ADDONS=./.ttt
2073 mkdir ./.ttt || exit 1
2077 : > 'diet\ is \curd.txt'
2078 : > 'diet "is
" curd.txt'
2080 : > 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
2081 : > höde__tröge__müde__dätte__hätte__vuelle__guelle__aese__aesse__sauerliche__kräuter__österliche__grüße__mäh.txt
2082 : > hööööööööööööööööö_nöööööööööööööööööööööö_düüüüüüüüüüüüüüüüüüü_bäääääääääääääääääääääääh.txt
2083 : > ✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆.txt
2085 echo bla | "${SNAIL}" ${ARGS} ${ADDARG_UNI} \
2086 -a "./.ttt/ma'ger.txt" -a "./.ttt/mä'ger.txt" \
2087 -a './.ttt/diet\ is \curd.txt' -a './.ttt/diet "is" curd.txt' \
2088 -a .
/.ttt
/höde-tröge.txt \
2089 -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 \
2090 -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 \
2091 -a .
/.ttt
/hööööööööööööööööö_nöööööööööööööööööööööö_düüüüüüüüüüüüüüüüüüü_bäääääääääääääääääääääääh.txt \
2092 -a .
/.ttt
/✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆.txt \
2095 cksum_test content
:14 "${MBOX}" '589846634 2491'
2097 printf "Resend ${BODY}\nx\n" | "${SNAIL}" ${ARGS} -f "${MBOX}"
2098 cksum_test content
:14-2 "${MBOX}" '589846634 2491'
2102 if have_feat devel
; then
2103 ARGS
="${ARGS} -Smemdebug"
2110 if [ -z "${CHECK_ONLY}" ]; then
2116 [ ${ESTAT} -eq 0 ] && echo Ok ||
echo >&2 'Errors occurred'