2 #@ Usage: ./cc-test.sh [--check-only [s-nail-binary]]
4 ARGS
='-:/ -# -Sdotlock-ignore-error -Sencoding=quoted-printable -Sstealthmua'
5 ARGS
="${ARGS}"' -Snosave -Sexpandaddr=restrict'
6 ARGS
="${ARGS}"' -Slog-prefix=classico:'
11 #UTF8_LOCALE= autodetected unless set
13 if ( command -v command ) >/dev
/null
2>&1; then :; else
20 MAKE
="${MAKE:-`command -v make`}"
21 awk=${awk:-`command -v awk`}
22 cat=${cat:-`command -v cat`}
23 cksum=${cksum:-`command -v cksum`}
24 rm=${rm:-`command -v rm`}
25 sed=${sed:-`command -v sed`}
26 grep=${grep:-`command -v grep`}
30 export SNAIL ARGS CONF BODY MBOX MAIL MAKE
awk cat cksum rm sed grep
32 LC_ALL
=C LANG
=C ADDARG_UNI
=-Sttycharset=UTF-8
34 # Wed Oct 2 01:50:07 UTC 1996
35 SOURCE_DATE_EPOCH
=844221007
37 export LC_ALL LANG ADDARG_UNI TZ SOURCE_DATE_EPOCH
40 # Problem: force $SHELL to be a real shell. It seems some testing environments
41 # use nologin(?), but we need a real shell for command execution
42 if { echo ${SHELL} | ${grep} nologin; } >/dev
/null
2>&1; then
43 echo >&2 '$SHELL seems to be nologin, overwriting to /bin/sh!'
48 if [ -z "${UTF8_LOCALE}" ]; then
50 if command -v locale
>/dev
/null
2>&1; then
51 UTF8_LOCALE
=`locale -a | { m=
53 if { echo ${n} | ${grep} -i 'utf-\{0,1\}8'; } >/dev/null 2>&1; then
55 if { echo ${n} | ${grep} -e POSIX -e en_EN -e en_US; }; then
69 echo >&2 "Usage: ./cc-test.sh [--check-only [s-nail-binary]]"
75 [ "${1}" = --check-only ] || usage
76 [ ${#} -gt 2 ] && usage
77 [ ${#} -eq 2 ] && SNAIL
="${2}"
78 [ -x "${SNAIL}" ] || usage
83 trap "${rm} -rf \"${BODY}\" \"${MBOX}\" \${TRAP_EXIT_ADDONS}" EXIT
84 trap "exit 1" HUP INT TERM
87 # Test all configs TODO doesn't cover all *combinations*, stupid!
91 NOTME["OPT_AUTOCC"] = 1
92 NOTME["OPT_DEBUG"] = 1
93 NOTME["OPT_DEVEL"] = 1
94 NOTME["OPT_NOEXTMD5"] = 1
95 NOTME["OPT_NOMEMDBG"] = 1
100 sub(/^[[:space:]]*/, "")
101 # This bails for UnixWare 7.1.4 awk(1), but preceeding = with \
102 # does not seem to be a compliant escape for =
104 $1 = substr($1, 1, index($1, "=") - 1)
110 # Doing this completely sequentially and not doing make distclean in
111 # between runs should effectively result in lesser compilations.
112 # It is completely dumb nonetheless... TODO
113 for (j = 1; j < i; ++j) {
114 for (k = 1; k < j; ++k)
116 for (k = j; k < i; ++k)
118 printf "OPT_AUTOCC=1\n"
120 for (j = 1; j < i; ++j) {
121 for (k = 1; k < j; ++k)
123 for (k = j; k < i; ++k)
125 printf "OPT_AUTOCC=1\n"
128 for (j = 1; j < i; ++j) {
129 for (k = 1; k < j; ++k)
131 for (k = j; k < i; ++k)
133 printf "OPT_AUTOCC=1\n"
134 printf "OPT_DEBUG=1\n"
136 for (j = 1; j < i; ++j) {
137 for (k = 1; k < j; ++k)
139 for (k = j; k < i; ++k)
141 printf "OPT_AUTOCC=1\n"
142 printf "OPT_DEBUG=1\n"
145 printf "CONFIG=NULL OPT_AUTOCC=0\n"
146 printf "CONFIG=NULL OPT_AUTOCC=1\n"
147 printf "CONFIG=NULLI OPT_AUTOCC=0\n"
148 printf "CONFIG=NULLI OPT_AUTOCC=1\n"
149 printf "CONFIG=MINIMAL OPT_AUTOCC=0\n"
150 printf "CONFIG=MINIMAL OPT_AUTOCC=1\n"
151 printf "CONFIG=MEDIUM OPT_AUTOCC=0\n"
152 printf "CONFIG=MEDIUM OPT_AUTOCC=1\n"
153 printf "CONFIG=NETSEND OPT_AUTOCC=0\n"
154 printf "CONFIG=NETSEND OPT_AUTOCC=1\n"
155 printf "CONFIG=MAXIMAL OPT_AUTOCC=0\n"
156 printf "CONFIG=MAXIMAL OPT_AUTOCC=1\n"
157 printf "CONFIG=DEVEL OPT_AUTOCC=0\n"
158 printf "CONFIG=DEVEL OPT_AUTOCC=1\n"
159 printf "CONFIG=ODEVEL OPT_AUTOCC=0\n"
160 printf "CONFIG=ODEVEL OPT_AUTOCC=1\n"
163 printf "\n\n##########\n$c\n"
164 printf "\n\n##########\n$c\n" >&2
172 # Read mailbox $2, strip non-constant headers and MIME boundaries, query the
173 # cksum(1) of the resulting data and compare against the checksum $3
175 tid
=${1} f=${2} s=${3}
177 csum
="`${sed} -e '/^From /d' \
178 -e '/^ boundary=/d' -e '/^--=-=/d' < \"${f}\" \
179 -e '/^\[-- Message/d' | ${cksum}`";
180 if [ "${csum}" = "${s}" ]; then
184 printf 'error: checksum mismatch (got %s)\n' "${csum}"
189 ( "${SNAIL}" ${ARGS} -X'echo $features' -Xx | ${grep} +${1} ) >/dev/null 2>&1
193 # Basic (easily testable) behaviour tests
195 t_behave_X_opt_input_command_stack
197 t_behave_input_inject_semicolon_seq
198 t_behave_commandalias
201 t_behave_macro_param_shift
207 # FIXME t_behave_alias
209 # FIXME t_behave_mlist
211 have_feat smime && t_behave_smime
214 t_behave_compose_hooks
217 t_behave_X_opt_input_command_stack() {
218 ${cat} <<- '__EOT' > "${BODY}"
226 echo "define mac1
{";\
227 echo " echo mac1-1 via1 \
$0";\
229 echo " echo mac1-2
";\
231 echo " echo mac1-3
";\
234 echo "define mac2
{";\
235 echo " echo mac2-1 via1 \
$0";\
237 echo " echo mac2-2
";\
243 echo echo 1-1-1 via1 \
$0;\
255 # The -X option supports multiline arguments, and those can internally use
256 # reverse solidus newline escaping. And all -X options are joined...
258 < "${BODY}" "${SNAIL}" ${ARGS} \
273 echo "define mac1 {";\
274 echo " echo mac1-1 via2 \$0";\
276 echo " echo mac1-2";\
278 echo " echo mac1-3";\
281 echo "define mac2 {";\
282 echo " echo mac2-1 via2 \$0";\
284 echo " echo mac2-2";\
290 echo echo 1-1-1 via2 \$0;\
302 ' > "${MBOX}" 2>/dev
/null
347 cksum_test behave
:x_opt_input_command_stack
"${MBOX}" '1391275936 378'
351 ${cat} <<- '__EOT' > "${BODY}"
370 echo 'a${DIET}b${TIED}c\${DIET}d\${TIED}e' # COMMENT
371 echo "a${DIET}b${TIED}c\${DIET}d\${TIED}e"
372 echo $'a${DIET}b${TIED}c\${DIET}d\${TIED}e'
374 echo a$'\101\0101\x41\u0041\u41\U00000041\U41'c
375 echo a$'\u0041\u41\u0C1\U00000041\U41'c
398 echo a$'b\U0000000'dt
399 echo a$'b\U00000000'du
409 if [ -z "${UTF8_LOCALE}" ]; then
410 echo 'Skip behave:wysh_unicode, no UTF8_LOCALE'
412 < "${BODY}" DIET=CURD TIED= \
413 LC_ALL=${UTF8_LOCALE} "${SNAIL}" ${ARGS} 2>/dev/null > "${MBOX}"
429 #a${DIET}b${TIED}c\${DIET}d\${TIED}e
430 #aCURDbc${DIET}d${TIED}e
431 #a${DIET}b${TIED}cCURDde
460 cksum_test behave:wysh_unicode "${MBOX}" '475805847 317'
463 < "${BODY}" DIET=CURD TIED= "${SNAIL}" ${ARGS} > "${MBOX}" 2>/dev/null
479 #a${DIET}b${TIED}c\${DIET}d\${TIED}e
480 #aCURDbc${DIET}d${TIED}e
481 #a${DIET}b${TIED}cCURDde
510 cksum_test behave:wysh_c "${MBOX}" '1473887148 321'
513 t_behave_input_inject_semicolon_seq() {
514 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} > "${MBOX}"
519 echon this_is_mymac;call mydeepmac;echon ';';
521 echon one';';~mymac;echon two";";call mymac;echo three$';';
523 echon this_is_mymac;call mydeepmac;echon ,TOO'!;';
525 echon one';';~mymac;echon two";";call mymac;echo three$';';
527 #one;this_is_mymac(mydeepmac);two;this_is_mymac(mydeepmac);three;
528 #one;this_is_mymac(mydeepmac),TOO!;two;this_is_mymac(mydeepmac),TOO!;three;
529 cksum_test behave:input_inject_semicolon_seq "${MBOX}" '512117110 140'
532 t_behave_commandalias() {
533 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} > "${MBOX}"
534 commandalias echo echo hoho
538 commandalias XxX XxXx
539 commandalias XxXx XxXxX
540 commandalias XxXxX XxXxXx
541 commandalias XxXxXx echo huhu
542 commandalias XxXxXxX echo huhu
544 commandalias XxXxXx XxXxXxX
547 commandalias XxXxXx echo huhu
554 cksum_test behave:commandalias "${MBOX}" '3694143612 31'
558 # Nestable conditions test
559 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} > "${MBOX}"
581 if $dietcurd == 'yoho'
586 if $dietcurd != 'yoho'
647 if $dietcurd == 'yohu'
649 elif $dietcurd == 'yoha'
651 elif $dietcurd == 'yohe'
653 elif $dietcurd == 'yoho'
655 if $dietcurd == 'yohu'
657 elif $dietcurd == 'yoha'
659 elif $dietcurd == 'yohe'
661 elif $dietcurd == 'yoho'
663 if $dietcurd == 'yohu'
665 elif $dietcurd == 'yoha'
667 elif $dietcurd == 'yohe'
669 elif $dietcurd == 'yoho'
680 # integer conversion, <..>..
783 set diet=abc curd=abc
789 set diet=abc curd=abcd
795 # 1. Shitty grouping capabilities as of today
796 unset diet curd ndefined
797 if [ [ false ] || [ false ] || [ true ] ] && [ [ false ] || [ true ] ] && \
803 if [ [ [ [ 0 ] || [ 1 ] ] && [ [ 1 ] || [ 0 ] ] ] && [ 1 ] ] && [ yes ]
808 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] ]
813 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] ]
818 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] || [ 1 ] ] && [ no ]
823 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] || [ 1 ] ] \
829 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 1 ] ]
834 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 0 ] ]
839 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 0 ] ] && [ 1 ] ] ] && [ 1 ] ]
844 if [ [ [ [ [ [ [ 0 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 1 ] ]
849 if [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] && [ 0 ]
854 if [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] && [ 1 ]
859 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ]
864 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 1 ]
869 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ] || [ 1 ] && [ 0 ]
874 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ] || [ 1 ] && [ 1 ]
880 if [ [ $diet == 'yo' ] && [ $curd == 'ho' ] ] && [ $ndefined ]
886 if [ [ $diet == 'yo' ] && [ $curd == 'ho' ] ] && [ $ndefined ]
891 # 2. Shitty grouping capabilities as of today
892 unset diet curd ndefined
893 if [ false || false || true ] && [ false || true ] && yes
898 if [ [ [ 0 || 1 ] && [ 1 || 0 ] ] && 1 ] && [ yes ]
903 if [ 1 || 0 || 0 || 0 ]
908 if [ 1 || 0 || 0 || 0 || [ 1 ] ]
913 if [ 1 || 0 || 0 || 0 || [ 1 ] || 1 ] && no
918 if [ 1 || 0 || 0 || 0 || 1 || [ 1 ] ] && no || [ yes ]
923 if [ [ [ [ [ [ 1 ] && 1 ] && 1 ] && 1 ] ] && [ 1 ] ]
928 if [ [ [ [ [ [ 1 ] && 1 ] && 1 ] && [ 1 ] ] ] && 0 ]
933 if [ [ [ [ [ [ [ 1 ] ] && 1 ] && 0 ] && [ 1 ] ] ] && 1 ]
938 if [ [ [ [ [ [ 0 ] && 1 ] && 1 ] && 1 ] ] && 1 ]
943 if 1 || 0 || 0 || 0 && 0
948 if 1 || 0 || 0 || 0 && 1
953 if 0 || 0 || 0 || 1 && 0
958 if 0 || 0 || 0 || 1 && 1
963 if 0 || 0 || 0 || 1 && 0 || 1 && 0
968 if 0 || 0 || 0 || 1 && 0 || 1 && 1
974 if [ $diet == 'yo' && $curd == 'ho' ] && $ndefined
979 if $diet == 'yo' && $curd == 'ho' && $ndefined
985 if [ $diet == 'yo' && $curd == 'ho' ] && $ndefined
990 if $diet == 'yo' && $curd == 'ho' && $ndefined
995 if [ [ [ [ [ [ $diet == 'yo' && $curd == 'ho' && $ndefined ] ] ] ] ] ]
1000 # Some more en-braced variables
1002 if ${diet} == ${curd}
1007 if ${diet} != ${curd}
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 ] ] ] ] ] && 3
1058 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] || 3
1063 if [ ! 0 ] && [ ! ! [ ! ! 1 ] ] && [ ! ! [ ! ! [ ! ! [ ! ! [ 2 ] ] ] ] ]
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 ] ] ] ] && 3
1104 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ ! 0 ] ] ] ] ] || 3
1109 if [ ! 0 ] && [ ! ! [ ! ! 1 ] ] && [ ! ! [ ! ! [ ! ! [ ! [ 0 ] ] ] ] ]
1115 cksum_test behave:if-normal "${MBOX}" '557629289 631'
1117 if have_feat regex; then
1118 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} > "${MBOX}"
1120 if $dietcurd =~ '^yo.*'
1125 if $dietcurd =~ '^yoho.+'
1130 if $dietcurd !~ '.*ho$'
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 if ! ! ! $dietcurd =~ '.+yoho$'
1180 if ! [ ! ! [ ! [ $dietcurd !~ '.+yoho$' ] ] ]
1185 set diet=abc curd='^abc$'
1191 set diet=abc curd='^abcd$'
1198 cksum_test behave:if-regex "${MBOX}" '439960016 81'
1202 t_behave_localopts() {
1203 # Nestable conditions test
1204 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} > "${MBOX}"
1219 echo $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2
1224 echo $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2
1225 echo "$gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2"
1234 echo active trouble: $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t3
1236 echo active null: $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t3
1242 #gv1 lv1 lv2 lv3 gv2, t2
1250 #gv1 lv1 lv2 lv3 gv2, t2
1253 #active trouble: gv1 gv2,
1255 cksum_test behave:localopts "${MBOX}" '1936527193 192'
1258 t_behave_macro_param_shift() {
1259 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} > "${MBOX}" 2>/dev/null
1262 echo t2.0 has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1267 echo t2.1 has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1268 if [ $# > 1 ] || [ $ignerr == '' ]
1273 echo t2.2:$? has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1275 echo t2.3:$? has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1279 echo t2.4:$? has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1284 call t2 1 you get four args
1285 echo t1.1: $?';' ignerr ($ignerr) should not exist
1286 call t2 1 you get 'three args'
1287 echo t1.2: $?';' ignerr ($ignerr) should not exist
1288 call t2 1 you 'get two args'
1289 echo t1.3: $?';' ignerr ($ignerr) should not exist
1290 call t2 1 'you get one arg'
1291 echo t1.4: $?';' ignerr ($ignerr) should not exist
1292 ignerr call t2 '' 'you get one arg'
1293 echo t1.5: $?';' ignerr ($ignerr) should not exist
1299 #t2.0 has 5/5 parameters: 1,you,get (1 you get four args) [1 you get four args]
1300 #t2.1 has 4/4 parameters: you,get,four (you get four args) [you get four args]
1301 #t2.2:0 has 2/2 parameters: four,args, (four args) [four args]
1302 #t2.3:0 has 2/2 parameters: four,args, (four args) [four args]
1303 #t2.4:0 has 1/1 parameters: args,, (args) [args]
1304 #t1.1: 0; ignerr () should not exist
1306 #t2.0 has 4/4 parameters: 1,you,get (1 you get three args) [1 you get three args]
1307 #t2.1 has 3/3 parameters: you,get,three args (you get three args) [you get three args]
1308 #t2.2:0 has 1/1 parameters: three args,, (three args) [three args]
1309 #t2.3:0 has 1/1 parameters: three args,, (three args) [three args]
1310 #t2.4:0 has 0/0 parameters: ,, () []
1311 #t1.2: 0; ignerr () should not exist
1313 #t2.0 has 3/3 parameters: 1,you,get two args (1 you get two args) [1 you get two args]
1314 #t2.1 has 2/2 parameters: you,get two args, (you get two args) [you get two args]
1315 #t2.2:0 has 0/0 parameters: ,, () []
1316 #t2.3:0 has 0/0 parameters: ,, () []
1317 #t2.4:0 has 0/0 parameters: ,, () []
1318 #t1.3: 0; ignerr () should not exist
1320 #t2.0 has 2/2 parameters: 1,you get one arg, (1 you get one arg) [1 you get one arg]
1321 #t2.1 has 1/1 parameters: you get one arg,, (you get one arg) [you get one arg]
1322 #t2.2:0 has 1/1 parameters: you get one arg,, (you get one arg) [you get one arg]
1323 #t2.3:0 has 1/1 parameters: you get one arg,, (you get one arg) [you get one arg]
1324 #t2.4:0 has 0/0 parameters: ,, () []
1325 #t1.4: 0; ignerr () should not exist
1327 #t2.0 has 2/2 parameters: ,you get one arg, ( you get one arg) [ you get one arg]
1328 #t2.1 has 1/1 parameters: you get one arg,, (you get one arg) [you get one arg]
1329 #t1.5: 1; ignerr () should not exist
1330 cksum_test behave:macro_param_shift "${MBOX}" '1402489146 1682'
1333 t_behave_addrcodec() {
1334 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} > "${MBOX}"
1335 vput addrcodec res e 1 <doog@def>
1336 echo $?/$^ERRNAME $res
1337 eval vput addrcodec res d $res
1338 echo $?/$^ERRNAME $res
1339 vput addrcodec res e 2 . <doog@def>
1340 echo $?/$^ERRNAME $res
1341 eval vput addrcodec res d $res
1342 echo $?/$^ERRNAME $res
1343 vput addrcodec res e 3 Sauer Dr. <doog@def>
1344 echo $?/$^ERRNAME $res
1345 eval vput addrcodec res d $res
1346 echo $?/$^ERRNAME $res
1347 vput addrcodec res e 3.50 Sauer (Ma) Dr. <doog@def>
1348 echo $?/$^ERRNAME $res
1349 eval vput addrcodec res d $res
1350 echo $?/$^ERRNAME $res
1351 vput addrcodec res e 3.51 Sauer (Ma) "Dr." <doog@def>
1352 echo $?/$^ERRNAME $res
1353 eval vput addrcodec res d $res
1354 echo $?/$^ERRNAME $res
1356 vput addrcodec res +e 4 Sauer (Ma) Dr. <doog@def>
1357 echo $?/$^ERRNAME $res
1358 eval vput addrcodec res d $res
1359 echo $?/$^ERRNAME $res
1360 vput addrcodec res +e 5 Sauer (Ma) Braten Dr. <doog@def>
1361 echo $?/$^ERRNAME $res
1362 eval vput addrcodec res d $res
1363 echo $?/$^ERRNAME $res
1364 vput addrcodec res +e 6 Sauer (Ma) Braten Dr. (Heu) <doog@def>
1365 echo $?/$^ERRNAME $res
1366 eval vput addrcodec res d $res
1367 echo $?/$^ERRNAME $res
1368 vput addrcodec res +e 7 Sauer (Ma) Braten Dr. (Heu) <doog@def> (bu)
1369 echo $?/$^ERRNAME $res
1370 eval vput addrcodec res d $res
1371 echo $?/$^ERRNAME $res
1372 vput addrcodec res +e 8 \
1373 Dr. Sauer (Ma) Braten Dr. (Heu) <doog@def> (bu) Boom. Boom
1374 echo $?/$^ERRNAME $res
1375 eval vput addrcodec res d $res
1376 echo $?/$^ERRNAME $res
1377 vput addrcodec res +e 9 Dr.Sauer(Ma)Braten Dr. (Heu) <doog@def>
1378 echo $?/$^ERRNAME $res
1379 eval vput addrcodec res d $res
1380 echo $?/$^ERRNAME $res
1381 vput addrcodec res +e 10 (Ma)Braten Dr. (Heu) <doog@def>
1382 echo $?/$^ERRNAME $res
1383 eval vput addrcodec res d $res
1384 echo $?/$^ERRNAME $res
1385 vput addrcodec res +e 11 (Ma)Braten Dr"." (Heu) <doog@def>
1386 echo $?/$^ERRNAME $res
1387 eval vput addrcodec res d $res
1388 echo $?/$^ERRNAME $res
1389 vput addrcodec res +e 12 Dr. Sauer (Ma) Braten Dr. (u) <doog@def>
1390 echo $?/$^ERRNAME $res
1391 eval vput addrcodec res d $res
1392 echo $?/$^ERRNAME $res
1393 vput addrcodec res +e 13(Ma)Braten Dr. (Heu) <doog@def>
1394 echo $?/$^ERRNAME $res
1395 eval vput addrcodec res d $res
1396 echo $?/$^ERRNAME $res
1397 vput addrcodec res +e 14 Hey, Du <doog@def> Wie() findet Dr. das? ()
1398 echo $?/$^ERRNAME $res
1399 eval vput addrcodec res d $res
1400 echo $?/$^ERRNAME $res
1401 vput addrcodec res +e 15 \
1402 Hey, Du <doog@def> Wie() findet "" Dr. "" das? ()
1403 echo $?/$^ERRNAME $res
1404 eval vput addrcodec res d $res
1405 echo $?/$^ERRNAME $res
1406 vput addrcodec res +e 16 \
1407 "Hey," "Du" <doog@def> "Wie()" findet "" Dr. "" das? ()
1408 echo $?/$^ERRNAME $res
1409 eval vput addrcodec res d $res
1410 echo $?/$^ERRNAME $res
1411 vput addrcodec res +e 17 \
1412 "Hey" Du <doog@def> "Wie() findet " " Dr. """ das? ()
1413 echo $?/$^ERRNAME $res
1414 eval vput addrcodec res d $res
1415 echo $?/$^ERRNAME $res
1416 vput addrcodec res +e 18 \
1417 <doog@def> "Hey" Du "Wie() findet " " Dr. """ das? ()
1418 echo $?/$^ERRNAME $res
1419 eval vput addrcodec res d $res
1420 echo $?/$^ERRNAME $res
1421 vput addrcodec res +e 19 Hey\,\" <doog@def> "Wie()" findet \" Dr. \" das?
1422 echo $?/$^ERRNAME $res
1423 eval vput addrcodec res d $res
1424 echo $?/$^ERRNAME $res
1426 vput addrcodec res ++e 20 Hey\,\" <doog@def> "Wie()" findet \" Dr. \" das?
1427 echo $?/$^ERRNAME $res
1428 vput addrcodec res ++e 21 Hey\,\"" <doog@def> "Wie()" findet \" Dr. \" das?
1429 echo $?/$^ERRNAME $res
1430 eval vput addrcodec res d $res
1431 echo $?/$^ERRNAME $res
1433 vput addrcodec res +++e 22 Hey\,\" <doog@def> "Wie()" findet \" Dr. \" das?
1434 echo $?/$^ERRNAME $res
1435 eval vput addrcodec res d $res
1436 echo $?/$^ERRNAME $res
1438 vput addrcodec res s \
1439 "23 Hey\\,\\\" \"Wie" () "\" findet \\\" Dr. \\\" das?" <doog@def>
1440 echo $?/$^ERRNAME $res
1442 #0/NONE 1 <doog@def>
1443 #0/NONE 1 <doog@def>
1444 #0/NONE "2 ." <doog@def>
1445 #0/NONE 2 . <doog@def>
1446 #0/NONE "3 Sauer Dr." <doog@def>
1447 #0/NONE 3 Sauer Dr. <doog@def>
1448 #0/NONE 3.50 "Sauer \(Ma\) Dr." <doog@def>
1449 #0/NONE 3.50 Sauer (Ma) Dr. <doog@def>
1450 #0/NONE 3.51 "Sauer \(Ma\) \"Dr.\"" <doog@def>
1451 #0/NONE 3.51 Sauer (Ma) "Dr." <doog@def>
1452 #0/NONE 4 Sauer (Ma) "Dr." <doog@def>
1453 #0/NONE 4 Sauer (Ma) Dr. <doog@def>
1454 #0/NONE 5 Sauer (Ma) "Braten Dr." <doog@def>
1455 #0/NONE 5 Sauer (Ma) Braten Dr. <doog@def>
1456 #0/NONE 6 Sauer (Ma) "Braten Dr." (Heu) <doog@def>
1457 #0/NONE 6 Sauer (Ma) Braten Dr. (Heu) <doog@def>
1458 #0/NONE 7 Sauer (Ma) "Braten Dr." (Heu bu) <doog@def>
1459 #0/NONE 7 Sauer (Ma) Braten Dr. (Heu bu) <doog@def>
1460 #0/NONE "8 Dr. Sauer" (Ma) "Braten Dr." (Heu bu) "Boom. Boom" <doog@def>
1461 #0/NONE 8 Dr. Sauer (Ma) Braten Dr. (Heu bu) Boom. Boom <doog@def>
1462 #0/NONE "9 Dr.Sauer" (Ma) "Braten Dr." (Heu) <doog@def>
1463 #0/NONE 9 Dr.Sauer (Ma) Braten Dr. (Heu) <doog@def>
1464 #0/NONE 10 (Ma) "Braten Dr." (Heu) <doog@def>
1465 #0/NONE 10 (Ma) Braten Dr. (Heu) <doog@def>
1466 #0/NONE 11 (Ma) "Braten Dr\".\"" (Heu) <doog@def>
1467 #0/NONE 11 (Ma) Braten Dr"." (Heu) <doog@def>
1468 #0/NONE "12 Dr. Sauer" (Ma) "Braten Dr." (u) <doog@def>
1469 #0/NONE 12 Dr. Sauer (Ma) Braten Dr. (u) <doog@def>
1470 #0/NONE 13 (Ma) "Braten Dr." (Heu) <doog@def>
1471 #0/NONE 13 (Ma) Braten Dr. (Heu) <doog@def>
1472 #0/NONE "14 Hey, Du Wie" () "findet Dr. das?" () <doog@def>
1473 #0/NONE 14 Hey, Du Wie () findet Dr. das? () <doog@def>
1474 #0/NONE "15 Hey, Du Wie" () "findet \"\" Dr. \"\" das?" () <doog@def>
1475 #0/NONE 15 Hey, Du Wie () findet "" Dr. "" das? () <doog@def>
1476 #0/NONE "16 \"Hey,\" \"Du\" \"Wie" () "\" findet \"\" Dr. \"\" das?" () <doog@def>
1477 #0/NONE 16 "Hey," "Du" "Wie () " findet "" Dr. "" das? () <doog@def>
1478 #0/NONE "17 \"Hey\" Du \"Wie" () "findet \" \" Dr. \"\"\" das?" () <doog@def>
1479 #0/NONE 17 "Hey" Du "Wie () findet " " Dr. """ das? () <doog@def>
1480 #0/NONE "18 \"Hey\" Du \"Wie" () "findet \" \" Dr. \"\"\" das?" () <doog@def>
1481 #0/NONE 18 "Hey" Du "Wie () findet " " Dr. """ das? () <doog@def>
1482 #0/NONE "19 Hey\\,\\\" \"Wie" () "\" findet \\\" Dr. \\\" das?" <doog@def>
1483 #0/NONE 19 Hey\,\" "Wie () " findet \" Dr. \" das? <doog@def>
1484 #1/INVAL 20 Hey\\,\\" <doog@def> "Wie()" findet \\" Dr. \\" das?
1485 #0/NONE "21 Hey\\,\\ Wie() findet \\ Dr. \\ das?" <doog@def>
1486 #0/NONE 21 Hey\,\ Wie() findet \ Dr. \ das? <doog@def>
1487 #0/NONE "22 Hey\,\" Wie() findet \" Dr. \" das?" <doog@def>
1488 #0/NONE 22 Hey," Wie() findet " Dr. " das? <doog@def>
1490 cksum_test behave:addrcodec "${MBOX}" '3907388894 2416'
1494 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} > "${MBOX}" 2>/dev/null
1495 vput vexpr res = 9223372036854775807
1496 echo $?/$^ERRNAME $res
1497 vput vexpr res = 9223372036854775808
1498 echo $?/$^ERRNAME $res
1499 vput vexpr res =@ 9223372036854775808
1500 echo $?/$^ERRNAME $res
1501 vput vexpr res = -9223372036854775808
1502 echo $?/$^ERRNAME $res
1503 vput vexpr res = -9223372036854775809
1504 echo $?/$^ERRNAME $res
1505 vput vexpr res =@ -9223372036854775809
1506 echo $?/$^ERRNAME $res
1509 echo $?/$^ERRNAME $res
1511 echo $?/$^ERRNAME $res
1513 echo $?/$^ERRNAME $res
1515 vput vexpr res + 0 0
1516 echo $?/$^ERRNAME $res
1517 vput vexpr res + 0 1
1518 echo $?/$^ERRNAME $res
1519 vput vexpr res + 1 1
1520 echo $?/$^ERRNAME $res
1522 vput vexpr res + 9223372036854775807 0
1523 echo $?/$^ERRNAME $res
1524 vput vexpr res + 9223372036854775807 1
1525 echo $?/$^ERRNAME $res
1526 vput vexpr res +@ 9223372036854775807 1
1527 echo $?/$^ERRNAME $res
1528 vput vexpr res + 0 9223372036854775807
1529 echo $?/$^ERRNAME $res
1530 vput vexpr res + 1 9223372036854775807
1531 echo $?/$^ERRNAME $res
1532 vput vexpr res +@ 1 9223372036854775807
1533 echo $?/$^ERRNAME $res
1535 vput vexpr res + -9223372036854775808 0
1536 echo $?/$^ERRNAME $res
1537 vput vexpr res + -9223372036854775808 -1
1538 echo $?/$^ERRNAME $res
1539 vput vexpr res +@ -9223372036854775808 -1
1540 echo $?/$^ERRNAME $res
1541 vput vexpr res + 0 -9223372036854775808
1542 echo $?/$^ERRNAME $res
1543 vput vexpr res + -1 -9223372036854775808
1544 echo $?/$^ERRNAME $res
1545 vput vexpr res +@ -1 -9223372036854775808
1546 echo $?/$^ERRNAME $res
1548 vput vexpr res - 0 0
1549 echo $?
/$^ERRNAME
$res
1550 vput vexpr res
- 0 1
1551 echo $?
/$^ERRNAME
$res
1552 vput vexpr res
- 1 1
1553 echo $?
/$^ERRNAME
$res
1555 vput vexpr res
- 9223372036854775807 0
1556 echo $?
/$^ERRNAME
$res
1557 vput vexpr res
- 9223372036854775807 -1
1558 echo $?
/$^ERRNAME
$res
1559 vput vexpr res
-@
9223372036854775807 -1
1560 echo $?
/$^ERRNAME
$res
1561 vput vexpr res
- 0 9223372036854775807
1562 echo $?
/$^ERRNAME
$res
1563 vput vexpr res
- -1 9223372036854775807
1564 echo $?
/$^ERRNAME
$res
1565 vput vexpr res
- -2 9223372036854775807
1566 echo $?
/$^ERRNAME
$res
1567 vput vexpr res
-@
-2 9223372036854775807
1568 echo $?
/$^ERRNAME
$res
1570 vput vexpr res
- -9223372036854775808 +0
1571 echo $?
/$^ERRNAME
$res
1572 vput vexpr res
- -9223372036854775808 +1
1573 echo $?
/$^ERRNAME
$res
1574 vput vexpr res
-@
-9223372036854775808 +1
1575 echo $?
/$^ERRNAME
$res
1576 vput vexpr res
- 0 -9223372036854775808
1577 echo $?
/$^ERRNAME
$res
1578 vput vexpr res
- +1 -9223372036854775808
1579 echo $?
/$^ERRNAME
$res
1580 vput vexpr res
-@
+1 -9223372036854775808
1581 echo $?
/$^ERRNAME
$res
1583 vput vexpr res
+ -13 -2
1584 echo $?
/$^ERRNAME
$res
1585 vput vexpr res
- 0 0
1586 echo $?
/$^ERRNAME
$res
1587 vput vexpr res
- 0 1
1588 echo $?
/$^ERRNAME
$res
1589 vput vexpr res
- 1 1
1590 echo $?
/$^ERRNAME
$res
1591 vput vexpr res
- -13 -2
1592 echo $?
/$^ERRNAME
$res
1594 vput vexpr res
* 0 0
1595 echo $?
/$^ERRNAME
$res
1596 vput vexpr res
* 0 1
1597 echo $?
/$^ERRNAME
$res
1598 vput vexpr res
* 1 1
1599 echo $?
/$^ERRNAME
$res
1600 vput vexpr res
* -13 -2
1601 echo $?
/$^ERRNAME
$res
1603 vput vexpr res
/ 0 0
1604 echo $?
/$^ERRNAME
$res
1605 vput vexpr res
/ 0 1
1606 echo $?
/$^ERRNAME
$res
1607 vput vexpr res
/ 1 1
1608 echo $?
/$^ERRNAME
$res
1609 vput vexpr res
/ -13 -2
1610 echo $?
/$^ERRNAME
$res
1612 vput vexpr res
% 0 0
1613 echo $?
/$^ERRNAME
$res
1614 vput vexpr res
% 0 1
1615 echo $?
/$^ERRNAME
$res
1616 vput vexpr res
% 1 1
1617 echo $?
/$^ERRNAME
$res
1618 vput vexpr res
% -13 -2
1619 echo $?
/$^ERRNAME
$res
1621 #0/NONE 9223372036854775807
1623 #0/OVERFLOW 9223372036854775807
1624 #0/NONE -9223372036854775808
1626 #0/OVERFLOW -9223372036854775808
1636 #0/NONE 9223372036854775807
1638 #0/OVERFLOW 9223372036854775807
1639 #0/NONE 9223372036854775807
1641 #0/OVERFLOW 9223372036854775807
1643 #0/NONE -9223372036854775808
1645 #0/OVERFLOW -9223372036854775808
1646 #0/NONE -9223372036854775808
1648 #0/OVERFLOW -9223372036854775808
1654 #0/NONE 9223372036854775807
1656 #0/OVERFLOW 9223372036854775807
1657 #0/NONE -9223372036854775807
1658 #0/NONE -9223372036854775808
1660 #0/OVERFLOW -9223372036854775808
1662 #0/NONE -9223372036854775808
1664 #0/OVERFLOW -9223372036854775808
1665 #0/NONE -9223372036854775808
1667 #0/OVERFLOW -9223372036854775808
1689 cksum_test behave
:vexpr-numeric
"${MBOX}" '1723609217 1048'
1691 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} > "${MBOX}" #2>/dev/null
1692 vput vexpr res find 'bananarama' 'nana'
1693 echo $?/$^ERRNAME :$res:
1694 vput vexpr res find 'bananarama' 'bana'
1695 echo $?/$^ERRNAME :$res:
1696 vput vexpr res find 'bananarama' 'Bana'
1697 echo $?/$^ERRNAME :$res:
1698 vput vexpr res find 'bananarama' 'rama'
1699 echo $?/$^ERRNAME :$res:
1701 vput vexpr res ifind 'bananarama' 'nana'
1702 echo $?/$^ERRNAME :$res:
1703 vput vexpr res ifind 'bananarama' 'bana'
1704 echo $?/$^ERRNAME :$res:
1705 vput vexpr res ifind 'bananarama' 'Bana'
1706 echo $?/$^ERRNAME :$res:
1707 vput vexpr res ifind 'bananarama' 'rama'
1708 echo $?/$^ERRNAME :$res:
1710 vput vexpr res substring 'bananarama' 1
1711 echo $?/$^ERRNAME :$res:
1712 vput vexpr res substring 'bananarama' 3
1713 echo $?/$^ERRNAME :$res:
1714 vput vexpr res substring 'bananarama' 5
1715 echo $?/$^ERRNAME :$res:
1716 vput vexpr res substring 'bananarama' 7
1717 echo $?/$^ERRNAME :$res:
1718 vput vexpr res substring 'bananarama' 9
1719 echo $?/$^ERRNAME :$res:
1720 vput vexpr res substring 'bananarama' 10
1721 echo $?/$^ERRNAME :$res:
1722 vput vexpr res substring 'bananarama' 1 3
1723 echo $?/$^ERRNAME :$res:
1724 vput vexpr res substring 'bananarama' 3 3
1725 echo $?/$^ERRNAME :$res:
1726 vput vexpr res substring 'bananarama' 5 3
1727 echo $?/$^ERRNAME :$res:
1728 vput vexpr res substring 'bananarama' 7 3
1729 echo $?/$^ERRNAME :$res:
1730 vput vexpr res substring 'bananarama' 9 3
1731 echo $?/$^ERRNAME :$res:
1732 vput vexpr res substring 'bananarama' 10 3
1733 echo $?/$^ERRNAME :$res:
1759 cksum_test behave:vexpr-string "${MBOX}" '265398700 267'
1761 if have_feat regex; then
1762 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} > "${MBOX}" #2>/dev/null
1763 vput vexpr res regex
'bananarama' 'nana'
1764 echo $?
/$^ERRNAME
:$res:
1765 vput vexpr res regex
'bananarama' 'bana'
1766 echo $?
/$^ERRNAME
:$res:
1767 vput vexpr res regex
'bananarama' 'Bana'
1768 echo $?
/$^ERRNAME
:$res:
1769 vput vexpr res regex
'bananarama' 'rama'
1770 echo $?
/$^ERRNAME
:$res:
1772 vput vexpr res iregex
'bananarama' 'nana'
1773 echo $?
/$^ERRNAME
:$res:
1774 vput vexpr res iregex
'bananarama' 'bana'
1775 echo $?
/$^ERRNAME
:$res:
1776 vput vexpr res iregex
'bananarama' 'Bana'
1777 echo $?
/$^ERRNAME
:$res:
1778 vput vexpr res iregex
'bananarama' 'rama'
1779 echo $?
/$^ERRNAME
:$res:
1781 vput vexpr res regex
'bananarama' '(.*)nana(.*)' '\${1}a\${0}u{\$2}'
1782 echo $?
/$^ERRNAME
:$res:
1783 vput vexpr res regex
'bananarama' '(.*)bana(.*)' '\${1}a\${0}u\$2'
1784 echo $?
/$^ERRNAME
:$res:
1785 vput vexpr res regex
'bananarama' 'Bana(.+)' '\$1\$0'
1786 echo $?
/$^ERRNAME
:$res:
1787 vput vexpr res regex
'bananarama' '(.+)rama' '\$1\$0'
1788 echo $?
/$^ERRNAME
:$res:
1790 vput vexpr res iregex
'bananarama' '(.*)nana(.*)' '\${1}a\${0}u{\$2}'
1791 echo $?
/$^ERRNAME
:$res:
1792 vput vexpr res iregex
'bananarama' '(.*)bana(.*)' '\${1}a\${0}u\$2'
1793 echo $?
/$^ERRNAME
:$res:
1794 vput vexpr res iregex
'bananarama' 'Bana(.+)' '\$1\$0'
1795 echo $?
/$^ERRNAME
:$res:
1796 vput vexpr res iregex
'bananarama' '(.+)rama' '\$1\$0'
1797 echo $?
/$^ERRNAME
:$res:
1810 #0/NONE :baabananaramau{rama}:
1811 #0/NONE :abananaramaunarama:
1813 #0/NONE :bananabananarama:
1815 #0/NONE :baabananaramau{rama}:
1816 #0/NONE :abananaramaunarama:
1817 #0/NONE :naramabananarama:
1818 #0/NONE :bananabananarama:
1820 cksum_test behave
:vexpr-regex
"${MBOX}" '3270360157 311'
1824 t_behave_call_ret
() {
1825 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} -Snomemdebug > "${MBOX}" 2>&1
1830 vput vexpr j '&' $i 7
1836 vput vexpr j '&' $i 7
1842 echo ! The end for $1
1846 # Transport $?/$! up the call chain
1856 echo ! The end for $1
1857 return $i $^ERR-BUSY
1861 # Up and down it goes
1868 vput vexpr k - $1 $2
1872 echo "# <$i/$j> .. "
1879 vput vexpr j
+ $^ERR-BUSY
$2
1880 echo ! The end
for $1=$i/$j
1886 call w1
0; echo ?
=$?
!=$
!; echo -----;
1887 call w2
0; echo ?
=$?
!=$
!; echo -----;
1888 call w3
0 1; echo ?
=$?
!=$
!; echo -----;
1890 cksum_test behave
:call_ret
"${MBOX}" '2240086482 5844'
1894 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} -Snomemdebug > "${MBOX}" 2>&1
1899 vput vexpr j '&' $i 7
1905 echo ! The end for $1/$2
1907 return $i $^ERR-BUSY
1925 cksum_test behave:xcall "${MBOX}" '1579767783 19097'
1928 t_behave_e_H_L_opts() {
1929 TRAP_EXIT_ADDONS=".
/.tsendmail.sh .
/.t.mbox
"
1932 "${SNAIL}" ${ARGS} -ef ./.t.mbox
1933 echo ${?} > "${MBOX}"
1935 ${cat} <<-_EOT > ./.tsendmail.sh
1937 (echo 'From Alchemilla Wed Apr 07 17:03:33 2017' && ${cat} && echo
1940 chmod 0755 ./.tsendmail.sh
1941 printf 'm me@exam.ple\nLine 1.\nHello.\n~.\n' |
1942 "${SNAIL}" ${ARGS} -Smta=./.tsendmail.sh
1943 printf 'm you@exam.ple\nLine 1.\nBye.\n~.\n' |
1944 "${SNAIL}" ${ARGS} -Smta=./.tsendmail.sh
1946 "${SNAIL}" ${ARGS} -ef ./.t.mbox
1947 echo ${?} >> "${MBOX}"
1948 "${SNAIL}" ${ARGS} -efL @t@me ./.t.mbox
1949 echo ${?} >> "${MBOX}"
1950 "${SNAIL}" ${ARGS} -efL @t@you ./.t.mbox
1951 echo ${?} >> "${MBOX}"
1952 "${SNAIL}" ${ARGS} -efL '@>@Line 1' ./.t.mbox
1953 echo ${?} >> "${MBOX}"
1954 "${SNAIL}" ${ARGS} -efL '@>@Hello.' ./.t.mbox
1955 echo ${?} >> "${MBOX}"
1956 "${SNAIL}" ${ARGS} -efL '@>@Bye.' ./.t.mbox
1957 echo ${?} >> "${MBOX}"
1958 "${SNAIL}" ${ARGS} -efL '@>@Good bye.' ./.t.mbox
1959 echo ${?} >> "${MBOX}"
1961 "${SNAIL}" ${ARGS} -fH ./.t.mbox >> "${MBOX}"
1962 echo ${?} >> "${MBOX}"
1963 "${SNAIL}" ${ARGS} -fL @t@me ./.t.mbox >> "${MBOX}"
1964 echo ${?} >> "${MBOX}"
1965 "${SNAIL}" ${ARGS} -fL @t@you ./.t.mbox >> "${MBOX}"
1966 echo ${?} >> "${MBOX}"
1967 "${SNAIL}" ${ARGS} -fL '@>@Line 1' ./.t.mbox >> "${MBOX}"
1968 echo ${?} >> "${MBOX}"
1969 "${SNAIL}" ${ARGS} -fL '@>@Hello.' ./.t.mbox >> "${MBOX}"
1970 echo ${?} >> "${MBOX}"
1971 "${SNAIL}" ${ARGS} -fL '@>@Bye.' ./.t.mbox >> "${MBOX}"
1972 echo ${?} >> "${MBOX}"
1973 "${SNAIL}" ${ARGS} -fL '@>@Good bye.' ./.t.mbox >> "${MBOX}" 2>/dev/null
1974 echo ${?} >> "${MBOX}"
1976 ${rm} -f ${TRAP_EXIT_ADDONS}
1987 #>N 1 Alchemilla 1996-10-02 01:50 7/112
1988 # N 2 Alchemilla 1996-10-02 01:50 7/111
1990 #>N 1 Alchemilla 1996-10-02 01:50 7/112
1992 # N 2 Alchemilla 1996-10-02 01:50 7/111
1994 #>N 1 Alchemilla 1996-10-02 01:50 7/112
1995 # N 2 Alchemilla 1996-10-02 01:50 7/111
1997 #>N 1 Alchemilla 1996-10-02 01:50 7/112
1999 # N 2 Alchemilla 1996-10-02 01:50 7/111
2002 cksum_test behave:e_H_L_opts "${MBOX}" '1708955574 678'
2005 t_behave_compose_hooks() {
2006 TRAP_EXIT_ADDONS=".
/.tsendmail.sh .
/.tnotes
"
2008 ${cat} <<-_EOT > ./.tsendmail.sh
2011 (echo 'From PrimulaVeris Wed Apr 10 22:59:00 2017' && ${cat}) > "${MBOX}"
2013 chmod 0755 ./.tsendmail.sh
2015 printf 'm hook-test@exam.ple\nbody\n~.\nvar t_oce t_ocs t_ocs_shell t_ocl' |
2016 "${SNAIL}" ${ARGS} \
2017 -Smta=./.tsendmail.sh \
2022 echo "~^header list
"; read hl; vput vexpr es substr "$hl" 0 1
2024 echoerr "Failed to header list
, aborting send
"; echo "~x
"
2026 echo "~^header insert cc splicy diet
<splice@exam.ple
> spliced
";\
2027 read es; vput vexpr es substr "$es" 0 1
2029 echoerr "Failed to be diet
, aborting send
"; echo "~x
"
2031 echo "~^header insert bcc juicy juice
<juice@exam.ple
> spliced
";\
2032 read es; vput vexpr es substr "$es" 0 1
2034 echoerr "Failed to be juicy
, aborting send
"; echo "~x
"
2039 set t_oce autobcc=oce@exam.ple
2042 set t_ocl autocc=ocl@exam.ple
2044 wysh set on-compose-splice=t_ocs \
2045 on-compose-splice-shell="read ver
;printf \"t_ocs-shell
\\n\
2046 ~t shell@exam.ple
\\n~
:set t_ocs_shell
\\n
\"" \
2047 on-compose-enter=t_oce on-compose-leave=t_ocl
2049 ${cat} ./.tnotes >> "${MBOX}"
2051 ${rm} -f ${TRAP_EXIT_ADDONS}
2054 #From PrimulaVeris Wed Apr 10 22:59:00 2017
2055 #Date: Wed, 02 Oct 1996 01:50:07 +0000
2056 #To: hook-test@exam.ple, shell@exam.ple
2057 #Cc: ocl@exam.ple, splicy diet spliced <splice@exam.ple>
2058 #Bcc: juicy juice spliced <juice@exam.ple>, oce@exam.ple
2063 ##variable not set: t_oce
2064 ##variable not set: t_ocs
2065 ##variable not set: t_ocs_shell
2066 ##variable not set: t_ocl
2067 cksum_test behave:compose_hooks "${MBOX}" '3240856112 319'
2070 t_behave_smime() { # FIXME add test/ dir, unroll tests therein
2071 TRAP_EXIT_ADDONS=".
/.t.conf .
/.tkey.pem .
/.tcert.pem .
/.tpair.pem
"
2072 TRAP_EXIT_ADDONS="${TRAP_EXIT_ADDONS} .
/.VERIFY .
/.DECRYPT .
/.ENCRYPT
"
2073 TRAP_EXIT_ADDONS="${TRAP_EXIT_ADDONS} .
/.tsendmail.sh
"
2075 printf 'behave:s/mime: .. generating test key and certificate ..\n'
2076 ${cat} <<-_EOT > ./.t.conf
2079 default_keyfile = keyfile.pem
2080 distinguished_name = req_distinguished_name
2081 attributes = req_attributes
2085 [ req_distinguished_name ]
2092 emailAddress = test@localhost
2097 openssl req -x509 -nodes -days 3650 -config ./.t.conf \
2098 -newkey rsa:1024 -keyout ./.tkey.pem -out ./.tcert.pem >/dev/null 2>&1
2099 ${cat} ./.tkey.pem ./.tcert.pem > ./.tpair.pem
2101 printf "behave
:s
/mime
:sign
/verify
: "
2102 echo bla | "${SNAIL}" ${ARGS} \
2103 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
2104 -Ssmime-sign -Sfrom=test@localhost \
2105 -s 'S/MIME test' ./.VERIFY
2106 printf 'verify\nx\n' |
2107 "${SNAIL}" ${ARGS} \
2108 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
2109 -Ssmime-sign -Sfrom=test@localhost \
2111 -f ./.VERIFY >/dev/null 2>&1
2112 if [ $? -eq 0 ]; then
2115 printf 'error: verification failed\n'
2117 ${rm} -f ${TRAP_EXIT_ADDONS}
2121 printf ' .. disproof via openssl smime(1): '
2122 if openssl smime -verify -CAfile ./.tcert.pem \
2123 -in ./.VERIFY >/dev/null 2>&1; then
2128 ${rm} -f ${TRAP_EXIT_ADDONS}
2133 # (signing +) encryption / decryption
2134 ${cat} <<-_EOT > ./.tsendmail.sh
2137 (echo 'From S-Postman Thu May 10 20:40:54 2012' && ${cat}) > ./.ENCRYPT
2139 chmod 0755 ./.tsendmail.sh
2141 printf "behave
:s
/mime
:encrypt
+sign
/decrypt
+verify
: "
2143 "${SNAIL}" ${ARGS} \
2144 -Ssmime-force-encryption \
2145 -Ssmime-encrypt-recei@ver.com=./.tpair.pem \
2146 -Smta=./.tsendmail.sh \
2147 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
2148 -Ssmime-sign -Sfrom=test@localhost \
2149 -s 'S/MIME test' recei@ver.com
2151 printf 'decrypt ./.DECRYPT\nfi ./.DECRYPT\nverify\nx\n' |
2152 "${SNAIL}" ${ARGS} \
2153 -Ssmime-force-encryption \
2154 -Ssmime-encrypt-recei@ver.com=./.tpair.pem \
2155 -Smta=./.tsendmail.sh \
2156 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
2157 -Ssmime-sign -Sfrom=test@localhost \
2159 -f ./.ENCRYPT >/dev/null 2>&1
2160 if [ $? -eq 0 ]; then
2164 printf 'error: decryption+verification failed\n'
2166 printf ' ..disproof via openssl smime(1): '
2167 if (openssl smime -decrypt -inkey ./.tkey.pem -in ./.ENCRYPT |
2168 openssl smime -verify -CAfile ./.tcert.pem) >/dev/null 2>&1; then
2174 ${sed} -e '/^Date:/d' -e '/^X-Decoding-Date/d' \
2176 '/^Content-Disposition: attachment; filename="smime.p7s
"/,/^-- /d' \
2177 < ./.DECRYPT > ./.ENCRYPT
2178 cksum_test ".. checksum of decrypted content
" ".
/.ENCRYPT
" '3090916509 510'
2180 printf "behave
:s
/mime
:encrypt
/decrypt
: "
2182 echo bla | "${SNAIL}" ${ARGS} \
2183 -Ssmime-force-encryption \
2184 -Ssmime-encrypt-recei@ver.com=./.tpair.pem \
2185 -Smta=./.tsendmail.sh \
2186 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
2187 -Sfrom=test@localhost \
2188 -s 'S/MIME test' recei@ver.com
2189 printf 'decrypt ./.DECRYPT\nx\n' | "${SNAIL}" ${ARGS} \
2190 -Ssmime-force-encryption \
2191 -Ssmime-encrypt-recei@ver.com=./.tpair.pem \
2192 -Smta=./.tsendmail.sh \
2193 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
2194 -Sfrom=test@localhost \
2196 -f ./.ENCRYPT >/dev/null 2>&1
2197 if [ $? -eq 0 ]; then
2201 printf 'error: decryption failed\n'
2203 printf '.. disproof via openssl smime(1): '
2204 if openssl smime -decrypt -inkey ./.tkey.pem \
2205 -in ./.ENCRYPT >/dev/null 2>&1; then
2211 ${sed} -e '/^Date:/d' -e '/^X-Decoding-Date/d' \
2212 < ./.DECRYPT > ./.ENCRYPT
2213 cksum_test ".. checksum of decrypted content
" ./.ENCRYPT '999887248 295'
2215 ${rm} -f ${TRAP_EXIT_ADDONS}
2220 # Some basic tests regarding correct sending of mails, via STDIN / -t / -q,
2221 # including basic MIME Content-Transfer-Encoding correctness (quoted-printable)
2222 # Note we unfortunately need to place some statements without proper
2223 # indentation because of continuation problems
2225 # MIME encoding (QP) stress message body
2227 'Ich bin eine DÖS-Datäi mit sehr langen Zeilen und auch '\
2228 'sonst bin ich ganz schön am Schleudern, da kannste denke '\
2229 "wasde willst
, gelle
, gelle
, gelle
, gelle
, gelle.
\r\n"\
2230 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
\r\n"\
2231 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
1\r\n"\
2232 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
12\r\n"\
2233 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
123\r\n"\
2234 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
1234\r\n"\
2235 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
12345\r\n"\
2236 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
123456\r\n"\
2237 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
1234567\r\n"\
2238 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
12345678\r\n"\
2239 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
123456789\r\n"\
2240 "Unn ausserdem habe ich trailing SP
/HT
/SP
/HT whitespace
\r\n"\
2241 "Unn ausserdem habe ich trailing HT
/SP
/HT
/SP whitespace
\r\n"\
2242 "auf den zeilen vorher.
\r\n"\
2243 "From am Zeilenbeginn und From der Mitte gibt es auch.
\r\n"\
2245 "Die letzte Zeile war nur ein Punkt.
\r\n"\
2247 "Das waren deren zwei.
\r\n"\
2249 "Die letzte Zeile war ein Leerschritt.
\n"\
2250 "=VIER
= EQUAL SIGNS
=ON A LINE
=\r\n"\
2253 "Die letzte Zeile war nur ein Punkt
, mit Unix Zeilenende.
\n"\
2255 "Das waren deren zwei. ditto.
\n"\
2257 "Unn ausseerdem habe ich trailing SP
/HT
/SP
/HT whitespace
\n"\
2258 "Unn ausseerdem habe ich trailing HT
/SP
/HT
/SP whitespace
\n"\
2259 "auf den zeilen vorher.
\n"\
2261 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende.
\n"\
2262 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.1"\
2264 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.12"\
2266 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.12"\
2268 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.12"\
2270 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.12"\
2272 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.12"\
2274 "QP am Zeilenende über soft-nl hinweg
\n"\
2275 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende.
"\
2277 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende.
"\
2279 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende.
"\
2281 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende.
"\
2283 "=VIER
= EQUAL SIGNS
=ON A LINE
=\n"\
2285 "Die letzte Zeile war ein Leerschritt.
\n"\
2289 # MIME encoding (QP) stress message subject
2290 SUB="Äbrä Kä?dä
=brö Fü?di
=bus? \
2291 adadaddsssssssddddddddddddddddddddd\
2292 ddddddddddddddddddddddddddddddddddd\
2293 ddddddddddddddddddddddddddddddddddd\
2294 dddddddddddddddddddd Hallelulja? Od\
2295 er?? eeeeeeeeeeeeeeeeeeeeeeeeeeeeee\
2296 eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\
2297 eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee f\
2298 fffffffffffffffffffffffffffffffffff\
2299 fffffffffffffffffffff ggggggggggggg\
2300 ggggggggggggggggggggggggggggggggggg\
2301 ggggggggggggggggggggggggggggggggggg\
2302 ggggggggggggggggggggggggggggggggggg\
2305 # Three tests for MIME encodign and (a bit) content classification.
2306 # At the same time testing -q FILE, < FILE and -t FILE
2309 < "${BODY}" "${SNAIL}" ${ARGS} ${ADDARG_UNI} \
2310 -a "${BODY}" -s "${SUB}" "${MBOX}"
2311 cksum_test content
:001 "${MBOX}" '2356108758 6413'
2314 < /dev
/null
"${SNAIL}" ${ARGS} ${ADDARG_UNI} \
2315 -a "${BODY}" -s "${SUB}" -q "${BODY}" "${MBOX}"
2316 cksum_test content:002 "${MBOX}" '2356108758 6413'
2319 ( echo "To
: ${MBOX}" && echo "Subject
: ${SUB}" && echo &&
2321 ) | "${SNAIL}" ${ARGS} ${ADDARG_UNI} -Snodot -a "${BODY}" -t
2322 cksum_test content:003 "${MBOX}" '2356108758 6413'
2324 # Test for [260e19d] (Juergen Daubert)
2326 echo body | "${SNAIL}" ${ARGS} "${MBOX}"
2327 cksum_test content:004 "${MBOX}" '4004005686 49'
2329 # Sending of multiple mails in a single invocation
2331 ( printf "m
${MBOX}\n~s subject1
\nE
-Mail Körper
1\n~.
\n" &&
2332 printf "m
${MBOX}\n~s subject2
\nEmail body
2\n~.
\n" &&
2334 ) | "${SNAIL}" ${ARGS} ${ADDARG_UNI}
2335 cksum_test content
:005 "${MBOX}" '2157252578 260'
2339 # "Test for" [d6f316a] (Gavin Troy)
2341 printf "m ${MBOX}\n~s subject1\nEmail body\n~.\nfi ${MBOX}\np\nx\n" |
2342 "${SNAIL}" ${ARGS} ${ADDARG_UNI} -Spipe-text/plain="${cat}" > "${BODY}"
2343 ${sed} -e 1d < "${BODY}" > "${MBOX}"
2344 cksum_test content:006 "${MBOX}" '2273863401 83'
2346 # "Test
for" [c299c45] (Peter Hofmann) TODO shouldn't end up QP-encoded?
2349 for(i = 0; i < 10000; ++i)
2351 #printf "\xF0\x90\x87\x90"
2352 }' | "${SNAIL}" ${ARGS} ${ADDARG_UNI} -s TestSubject "${MBOX}"
2353 cksum_test content:007 "${MBOX}" '1754234717 61767'
2355 ## Test some more corner cases for header bodies (as good as we can today) ##
2359 echo | "${SNAIL}" ${ARGS} ${ADDARG_UNI} \
2360 -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̲' \
2362 cksum_test content
:008 "${MBOX}" '1563381297 326'
2364 # Single word (overlong line split -- bad standard! Requires injection of
2365 # artificial data!! Bad can be prevented by using RFC 2047 encoding)
2367 i
=`${awk} 'BEGIN{for(i=0; i<92; ++i) printf "0123456789_"}'`
2368 echo |
"${SNAIL}" ${ARGS} -s "${i}" "${MBOX}"
2369 cksum_test content
:009 "${MBOX}" '1996714851 1669'
2371 # Combination of encoded words, space and tabs of varying sort
2373 echo |
"${SNAIL}" ${ARGS} ${ADDARG_UNI} \
2374 -s "1Abrä Kaspas1
2Abra Katä b_kaspas2 \
2375 3Abrä Kaspas3
4Abrä Kaspas4
5Abrä Kaspas5 \
2376 6Abra Kaspas6
7Abrä Kaspas7
8Abra Kaspas8 \
2377 9Abra Kaspastäb4-3
10Abra Kaspas1 _
11Abra Katäb1 \
2378 12Abra Kadabrä
1 After Tab after Täb this is NUTS
" \
2380 cksum_test content:010 "${MBOX}" '2956039469 542'
2382 # Overlong multibyte sequence that must be forcefully split
2383 # todo This works even before v15.0, but only by accident
2385 echo | "${SNAIL}" ${ARGS} ${ADDARG_UNI} \
2386 -s "✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄\
2387 ✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄\
2388 ✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄" \
2390 cksum_test content
:011 "${MBOX}" '454973928 610'
2394 echo |
"${SNAIL}" ${ARGS} \
2395 -s "1-1 B2 B3 B4 B5 B6 B\
2396 1-2 B2 B3 B4 B5 B6 B\
2397 1-3 B2 B3 B4 B5 B6 B\
2398 1-4 B2 B3 B4 B5 B6 B\
2399 1-5 B2 B3 B4 B5 B6 B\
2400 1-6 B2 B3 B4 B5 B6 " \
2402 cksum_test content
:012 "${MBOX}" '1014122962 248'
2404 # Leading and trailing WS
2406 echo |
"${SNAIL}" ${ARGS} \
2407 -s " 2-1 B2 B3 B4 B5 B6 B\
2408 1-2 B2 B3 B4 B5 B6 B\
2409 1-3 B2 B3 B4 B5 B6 B\
2410 1-4 B2 B3 B4 B5 B6 " \
2412 cksum_test content
:013 "${MBOX}" '3212167908 187'
2414 # Quick'n dirty RFC 2231 test; i had more when implementing it, but until we
2415 # have a (better) test framework materialize a quick shot
2417 TRAP_EXIT_ADDONS
=.
/.ttt
2419 mkdir .
/.ttt ||
exit 1
2423 : > 'diet\ is \curd.txt'
2424 : > 'diet "is" curd.txt'
2426 : > 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
2427 : > höde__tröge__müde__dätte__hätte__vuelle__guelle__aese__aesse__sauerliche__kräuter__österliche__grüße__mäh.txt
2428 : > hööööööööööööööööö_nöööööööööööööööööööööö_düüüüüüüüüüüüüüüüüüü_bäääääääääääääääääääääääh.txt
2429 : > ✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆.txt
2431 echo bla |
"${SNAIL}" ${ARGS} ${ADDARG_UNI} \
2432 -a ".
/.ttt
/ma
'ger.txt" -a "./.ttt/mä'ger.txt
" \
2433 -a './.ttt/diet\ is \curd.txt' -a './.ttt/diet "is
" curd.txt' \
2434 -a ./.ttt/höde-tröge.txt \
2435 -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 \
2436 -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 \
2437 -a ./.ttt/hööööööööööööööööö_nöööööööööööööööööööööö_düüüüüüüüüüüüüüüüüüü_bäääääääääääääääääääääääh.txt \
2438 -a ./.ttt/✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆.txt \
2441 cksum_test content:14 "${MBOX}" '589846634 2491'
2443 printf "Resend
${BODY}\nx\n" | "${SNAIL}" ${ARGS} -f "${MBOX}"
2444 cksum_test content:14-2 "${MBOX}" '589846634 2491'
2448 if have_feat devel; then
2449 ARGS="${ARGS} -Smemdebug"
2456 if [ -z "${CHECK_ONLY}" ]; then
2462 [ ${ESTAT} -eq 0 ] && echo Ok || echo >&2 'Errors occurred'