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
206 # FIXME t_behave_alias
208 # FIXME t_behave_mlist
210 have_feat smime && t_behave_smime
213 t_behave_compose_hooks
216 t_behave_X_opt_input_command_stack() {
217 ${cat} <<- '__EOT' > "${BODY}"
225 echo "define mac1
{";\
226 echo " echo mac1-1 via1 \
$0";\
228 echo " echo mac1-2
";\
230 echo " echo mac1-3
";\
233 echo "define mac2
{";\
234 echo " echo mac2-1 via1 \
$0";\
236 echo " echo mac2-2
";\
242 echo echo 1-1-1 via1 \
$0;\
254 # The -X option supports multiline arguments, and those can internally use
255 # reverse solidus newline escaping. And all -X options are joined...
257 < "${BODY}" "${SNAIL}" ${ARGS} \
272 echo "define mac1 {";\
273 echo " echo mac1-1 via2 \$0";\
275 echo " echo mac1-2";\
277 echo " echo mac1-3";\
280 echo "define mac2 {";\
281 echo " echo mac2-1 via2 \$0";\
283 echo " echo mac2-2";\
289 echo echo 1-1-1 via2 \$0;\
301 ' > "${MBOX}" 2>/dev
/null
346 cksum_test behave
:x_opt_input_command_stack
"${MBOX}" '1391275936 378'
350 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} -Snomemdebug > "${MBOX}" 2>&1
355 vput vexpr j '&' $i 7
361 echo ! The end for $1
373 cksum_test behave:xcall "${MBOX}" '3660556233 9556'
377 ${cat} <<- '__EOT' > "${BODY}"
396 echo 'a${DIET}b${TIED}c\${DIET}d\${TIED}e' # COMMENT
397 echo "a${DIET}b${TIED}c\${DIET}d\${TIED}e"
398 echo $
'a${DIET}b${TIED}c\${DIET}d\${TIED}e'
400 echo a$
'\101\0101\x41\u0041\u41\U00000041\U41'c
401 echo a$
'\u0041\u41\u0C1\U00000041\U41'c
424 echo a$
'b\U0000000'dt
425 echo a$
'b\U00000000'du
435 if [ -z "${UTF8_LOCALE}" ]; then
436 echo 'Skip behave:wysh_unicode, no UTF8_LOCALE'
438 < "${BODY}" DIET
=CURD TIED
= \
439 LC_ALL
=${UTF8_LOCALE} "${SNAIL}" ${ARGS} 2>/dev/null > "${MBOX}"
455 #a${DIET}b${TIED}c\${DIET}d\${TIED}e
456 #aCURDbc${DIET}d${TIED}e
457 #a${DIET}b${TIED}cCURDde
486 cksum_test behave
:wysh_unicode
"${MBOX}" '475805847 317'
489 < "${BODY}" DIET=CURD TIED= "${SNAIL}" ${ARGS} > "${MBOX}" 2>/dev
/null
505 #a${DIET}b${TIED}c\${DIET}d\${TIED}e
506 #aCURDbc${DIET}d${TIED}e
507 #a${DIET}b${TIED}cCURDde
536 cksum_test behave
:wysh_c
"${MBOX}" '1473887148 321'
539 t_behave_input_inject_semicolon_seq
() {
540 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} > "${MBOX}"
545 echon this_is_mymac;call mydeepmac;echon ';';
547 echon one';';~mymac;echon two";";call mymac;echo three$';';
549 echon this_is_mymac;call mydeepmac;echon ,TOO'!;';
551 echon one';';~mymac;echon two";";call mymac;echo three$';';
553 #one;this_is_mymac(mydeepmac);two;this_is_mymac(mydeepmac);three;
554 #one;this_is_mymac(mydeepmac),TOO!;two;this_is_mymac(mydeepmac),TOO!;three;
555 cksum_test behave:input_inject_semicolon_seq "${MBOX}" '512117110 140'
558 t_behave_commandalias() {
559 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} > "${MBOX}"
560 commandalias
echo echo hoho
564 commandalias XxX XxXx
565 commandalias XxXx XxXxX
566 commandalias XxXxX XxXxXx
567 commandalias XxXxXx
echo huhu
568 commandalias XxXxXxX
echo huhu
570 commandalias XxXxXx XxXxXxX
573 commandalias XxXxXx
echo huhu
580 cksum_test behave
:commandalias
"${MBOX}" '3694143612 31'
584 # Nestable conditions test
585 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} > "${MBOX}"
607 if $dietcurd == 'yoho'
612 if $dietcurd != 'yoho'
673 if $dietcurd == 'yohu'
675 elif $dietcurd == 'yoha'
677 elif $dietcurd == 'yohe'
679 elif $dietcurd == 'yoho'
681 if $dietcurd == 'yohu'
683 elif $dietcurd == 'yoha'
685 elif $dietcurd == 'yohe'
687 elif $dietcurd == 'yoho'
689 if $dietcurd == 'yohu'
691 elif $dietcurd == 'yoha'
693 elif $dietcurd == 'yohe'
695 elif $dietcurd == 'yoho'
706 # integer conversion, <..>..
809 set diet=abc curd=abc
815 set diet=abc curd=abcd
821 # 1. Shitty grouping capabilities as of today
822 unset diet curd ndefined
823 if [ [ false ] || [ false ] || [ true ] ] && [ [ false ] || [ true ] ] && \
829 if [ [ [ [ 0 ] || [ 1 ] ] && [ [ 1 ] || [ 0 ] ] ] && [ 1 ] ] && [ yes ]
834 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] ]
839 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] ]
844 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] || [ 1 ] ] && [ no ]
849 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] || [ 1 ] ] \
855 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 1 ] ]
860 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 0 ] ]
865 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 0 ] ] && [ 1 ] ] ] && [ 1 ] ]
870 if [ [ [ [ [ [ [ 0 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 1 ] ]
875 if [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] && [ 0 ]
880 if [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] && [ 1 ]
885 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ]
890 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 1 ]
895 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ] || [ 1 ] && [ 0 ]
900 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ] || [ 1 ] && [ 1 ]
906 if [ [ $diet == 'yo' ] && [ $curd == 'ho' ] ] && [ $ndefined ]
912 if [ [ $diet == 'yo' ] && [ $curd == 'ho' ] ] && [ $ndefined ]
917 # 2. Shitty grouping capabilities as of today
918 unset diet curd ndefined
919 if [ false || false || true ] && [ false || true ] && yes
924 if [ [ [ 0 || 1 ] && [ 1 || 0 ] ] && 1 ] && [ yes ]
929 if [ 1 || 0 || 0 || 0 ]
934 if [ 1 || 0 || 0 || 0 || [ 1 ] ]
939 if [ 1 || 0 || 0 || 0 || [ 1 ] || 1 ] && no
944 if [ 1 || 0 || 0 || 0 || 1 || [ 1 ] ] && no || [ yes ]
949 if [ [ [ [ [ [ 1 ] && 1 ] && 1 ] && 1 ] ] && [ 1 ] ]
954 if [ [ [ [ [ [ 1 ] && 1 ] && 1 ] && [ 1 ] ] ] && 0 ]
959 if [ [ [ [ [ [ [ 1 ] ] && 1 ] && 0 ] && [ 1 ] ] ] && 1 ]
964 if [ [ [ [ [ [ 0 ] && 1 ] && 1 ] && 1 ] ] && 1 ]
969 if 1 || 0 || 0 || 0 && 0
974 if 1 || 0 || 0 || 0 && 1
979 if 0 || 0 || 0 || 1 && 0
984 if 0 || 0 || 0 || 1 && 1
989 if 0 || 0 || 0 || 1 && 0 || 1 && 0
994 if 0 || 0 || 0 || 1 && 0 || 1 && 1
1000 if [ $diet == 'yo' && $curd == 'ho' ] && $ndefined
1005 if $diet == 'yo' && $curd == 'ho' && $ndefined
1011 if [ $diet == 'yo' && $curd == 'ho' ] && $ndefined
1016 if $diet == 'yo' && $curd == 'ho' && $ndefined
1021 if [ [ [ [ [ [ $diet == 'yo' && $curd == 'ho' && $ndefined ] ] ] ] ] ]
1026 # Some more en-braced variables
1028 if ${diet} == ${curd}
1033 if ${diet} != ${curd}
1049 if ! 0 && ! ! 1 && ! ! ! ! 2 && 3
1054 if ! 0 && ! [ ! 1 ] && ! [ ! [ ! [ ! 2 ] ] ] && 3
1059 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
1064 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && ! 3
1069 if [ ! 0 ] && [ ! [ ! 1 ] ] && ! [ [ ! [ ! [ ! [ 2 ] ] ] ] ] && ! 3
1074 if [ ! 0 ] && ! [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
1079 if ! [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
1084 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] || 3
1089 if [ ! 0 ] && [ ! ! [ ! ! 1 ] ] && [ ! ! [ ! ! [ ! ! [ ! ! [ 2 ] ] ] ] ]
1095 if ! 0 && ! ! 1 && ! ! ! 0 && 3
1100 if ! 0 && ! [ ! 1 ] && ! [ ! [ ! [ 0 ] ] ] && 3
1105 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ [ 0 ] ] ] ] ] && 3
1110 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! ! [ ! [ ! 0 ] ] ] ] && ! 3
1115 if [ ! 0 ] && [ ! [ ! 1 ] ] && ! [ ! [ ! [ ! [ ! 0 ] ] ] ] && 3
1120 if [ ! 0 ] && ! [ ! [ ! 1 ] ] && [ ! ! [ ! [ ! [ ! [ 0 ] ] ] ] ] && 3
1125 if ! [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! ! 0 ] ] ] ] && 3
1130 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ ! 0 ] ] ] ] ] || 3
1135 if [ ! 0 ] && [ ! ! [ ! ! 1 ] ] && [ ! ! [ ! ! [ ! ! [ ! [ 0 ] ] ] ] ]
1141 cksum_test behave:if-normal "${MBOX}" '557629289 631'
1143 if have_feat regex; then
1144 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} > "${MBOX}"
1146 if $dietcurd =~
'^yo.*'
1151 if $dietcurd =~
'^yoho.+'
1156 if $dietcurd !~
'.*ho$'
1161 if $dietcurd !~
'.+yoho$'
1166 if [ $dietcurd !~
'.+yoho$' ]
1171 if ! [ $dietcurd =~
'.+yoho$' ]
1176 if ! ! [ $dietcurd !~
'.+yoho$' ]
1181 if ! [ ! [ $dietcurd !~
'.+yoho$' ] ]
1186 if [ ! [ ! [ $dietcurd !~
'.+yoho$' ] ] ]
1191 if ! [ ! [ ! [ $dietcurd !~
'.+yoho$' ] ] ]
1196 if ! ! ! $dietcurd !~
'.+yoho$'
1201 if ! ! ! $dietcurd =~
'.+yoho$'
1206 if ! [ ! ! [ ! [ $dietcurd !~
'.+yoho$' ] ] ]
1211 set diet
=abc curd
='^abc$'
1217 set diet
=abc curd
='^abcd$'
1224 cksum_test behave
:if-regex
"${MBOX}" '439960016 81'
1228 t_behave_localopts
() {
1229 # Nestable conditions test
1230 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} > "${MBOX}"
1245 echo $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2
1250 echo $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2
1251 echo "$gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2"
1260 echo active trouble: $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t3
1262 echo active null: $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t3
1268 #gv1 lv1 lv2 lv3 gv2, t2
1276 #gv1 lv1 lv2 lv3 gv2, t2
1279 #active trouble: gv1 gv2,
1281 cksum_test behave:localopts "${MBOX}" '1936527193 192'
1284 t_behave_macro_param_shift() {
1285 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} > "${MBOX}" 2>/dev
/null
1288 echo t2.0 has
$#/${#} parameters: "$1,${2},$3" (${*}) [$@
]
1293 echo t2.1 has
$#/${#} parameters: "$1,${2},$3" (${*}) [$@
]
1294 if [ $# > 1 ] ||
[ $ignerr == '' ]
1299 echo t2.2
:$? has
$#/${#} parameters: "$1,${2},$3" (${*}) [$@
]
1301 echo t2.3
:$? has
$#/${#} parameters: "$1,${2},$3" (${*}) [$@
]
1305 echo t2.4
:$? has
$#/${#} parameters: "$1,${2},$3" (${*}) [$@
]
1310 call t2
1 you get four args
1311 echo t1.1
: $?
';' ignerr
($ignerr) should not exist
1312 call t2
1 you get
'three args'
1313 echo t1.2
: $?
';' ignerr
($ignerr) should not exist
1314 call t2
1 you
'get two args'
1315 echo t1.3
: $?
';' ignerr
($ignerr) should not exist
1316 call t2
1 'you get one arg'
1317 echo t1.4
: $?
';' ignerr
($ignerr) should not exist
1318 ignerr call t2
'' 'you get one arg'
1319 echo t1.5
: $?
';' ignerr
($ignerr) should not exist
1325 #t2.0 has 5/5 parameters: 1,you,get (1 you get four args) [1 you get four args]
1326 #t2.1 has 4/4 parameters: you,get,four (you get four args) [you get four args]
1327 #t2.2:0 has 2/2 parameters: four,args, (four args) [four args]
1328 #t2.3:0 has 2/2 parameters: four,args, (four args) [four args]
1329 #t2.4:0 has 1/1 parameters: args,, (args) [args]
1330 #t1.1: 0; ignerr () should not exist
1332 #t2.0 has 4/4 parameters: 1,you,get (1 you get three args) [1 you get three args]
1333 #t2.1 has 3/3 parameters: you,get,three args (you get three args) [you get three args]
1334 #t2.2:0 has 1/1 parameters: three args,, (three args) [three args]
1335 #t2.3:0 has 1/1 parameters: three args,, (three args) [three args]
1336 #t2.4:0 has 0/0 parameters: ,, () []
1337 #t1.2: 0; ignerr () should not exist
1339 #t2.0 has 3/3 parameters: 1,you,get two args (1 you get two args) [1 you get two args]
1340 #t2.1 has 2/2 parameters: you,get two args, (you get two args) [you get two args]
1341 #t2.2:0 has 0/0 parameters: ,, () []
1342 #t2.3:0 has 0/0 parameters: ,, () []
1343 #t2.4:0 has 0/0 parameters: ,, () []
1344 #t1.3: 0; ignerr () should not exist
1346 #t2.0 has 2/2 parameters: 1,you get one arg, (1 you get one arg) [1 you get one arg]
1347 #t2.1 has 1/1 parameters: you get one arg,, (you get one arg) [you get one arg]
1348 #t2.2:0 has 1/1 parameters: you get one arg,, (you get one arg) [you get one arg]
1349 #t2.3:0 has 1/1 parameters: you get one arg,, (you get one arg) [you get one arg]
1350 #t2.4:0 has 0/0 parameters: ,, () []
1351 #t1.4: 0; ignerr () should not exist
1353 #t2.0 has 2/2 parameters: ,you get one arg, ( you get one arg) [ you get one arg]
1354 #t2.1 has 1/1 parameters: you get one arg,, (you get one arg) [you get one arg]
1355 #t1.5: 1; ignerr () should not exist
1356 cksum_test behave
:macro_param_shift
"${MBOX}" '1402489146 1682'
1359 t_behave_addrcodec
() {
1360 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} > "${MBOX}"
1361 vput addrcodec res e 1 <doog@def>
1362 echo $?/$^ERRNAME $res
1363 eval vput addrcodec res d $res
1364 echo $?/$^ERRNAME $res
1365 vput addrcodec res e 2 . <doog@def>
1366 echo $?/$^ERRNAME $res
1367 eval vput addrcodec res d $res
1368 echo $?/$^ERRNAME $res
1369 vput addrcodec res e 3 Sauer Dr. <doog@def>
1370 echo $?/$^ERRNAME $res
1371 eval vput addrcodec res d $res
1372 echo $?/$^ERRNAME $res
1373 vput addrcodec res e 3.50 Sauer (Ma) Dr. <doog@def>
1374 echo $?/$^ERRNAME $res
1375 eval vput addrcodec res d $res
1376 echo $?/$^ERRNAME $res
1377 vput addrcodec res e 3.51 Sauer (Ma) "Dr.
" <doog@def>
1378 echo $?/$^ERRNAME $res
1379 eval vput addrcodec res d $res
1380 echo $?/$^ERRNAME $res
1382 vput addrcodec res +e 4 Sauer (Ma) Dr. <doog@def>
1383 echo $?/$^ERRNAME $res
1384 eval vput addrcodec res d $res
1385 echo $?/$^ERRNAME $res
1386 vput addrcodec res +e 5 Sauer (Ma) Braten Dr. <doog@def>
1387 echo $?/$^ERRNAME $res
1388 eval vput addrcodec res d $res
1389 echo $?/$^ERRNAME $res
1390 vput addrcodec res +e 6 Sauer (Ma) Braten Dr. (Heu) <doog@def>
1391 echo $?/$^ERRNAME $res
1392 eval vput addrcodec res d $res
1393 echo $?/$^ERRNAME $res
1394 vput addrcodec res +e 7 Sauer (Ma) Braten Dr. (Heu) <doog@def> (bu)
1395 echo $?/$^ERRNAME $res
1396 eval vput addrcodec res d $res
1397 echo $?/$^ERRNAME $res
1398 vput addrcodec res +e 8 \
1399 Dr. Sauer (Ma) Braten Dr. (Heu) <doog@def> (bu) Boom. Boom
1400 echo $?/$^ERRNAME $res
1401 eval vput addrcodec res d $res
1402 echo $?/$^ERRNAME $res
1403 vput addrcodec res +e 9 Dr.Sauer(Ma)Braten Dr. (Heu) <doog@def>
1404 echo $?/$^ERRNAME $res
1405 eval vput addrcodec res d $res
1406 echo $?/$^ERRNAME $res
1407 vput addrcodec res +e 10 (Ma)Braten Dr. (Heu) <doog@def>
1408 echo $?/$^ERRNAME $res
1409 eval vput addrcodec res d $res
1410 echo $?/$^ERRNAME $res
1411 vput addrcodec res +e 11 (Ma)Braten Dr".
" (Heu) <doog@def>
1412 echo $?/$^ERRNAME $res
1413 eval vput addrcodec res d $res
1414 echo $?/$^ERRNAME $res
1415 vput addrcodec res +e 12 Dr. Sauer (Ma) Braten Dr. (u) <doog@def>
1416 echo $?/$^ERRNAME $res
1417 eval vput addrcodec res d $res
1418 echo $?/$^ERRNAME $res
1419 vput addrcodec res +e 13(Ma)Braten Dr. (Heu) <doog@def>
1420 echo $?/$^ERRNAME $res
1421 eval vput addrcodec res d $res
1422 echo $?/$^ERRNAME $res
1423 vput addrcodec res +e 14 Hey, Du <doog@def> Wie() findet Dr. das? ()
1424 echo $?/$^ERRNAME $res
1425 eval vput addrcodec res d $res
1426 echo $?/$^ERRNAME $res
1427 vput addrcodec res +e 15 \
1428 Hey, Du <doog@def> Wie() findet "" Dr. "" das? ()
1429 echo $?/$^ERRNAME $res
1430 eval vput addrcodec res d $res
1431 echo $?/$^ERRNAME $res
1432 vput addrcodec res +e 16 \
1433 "Hey
," "Du
" <doog@def> "Wie
()" findet "" Dr. "" das? ()
1434 echo $?/$^ERRNAME $res
1435 eval vput addrcodec res d $res
1436 echo $?/$^ERRNAME $res
1437 vput addrcodec res +e 17 \
1438 "Hey
" Du <doog@def> "Wie
() findet
" " Dr.
""" das? ()
1439 echo $?/$^ERRNAME $res
1440 eval vput addrcodec res d $res
1441 echo $?/$^ERRNAME $res
1442 vput addrcodec res +e 18 \
1443 <doog@def> "Hey
" Du "Wie
() findet
" " Dr.
""" das? ()
1444 echo $?/$^ERRNAME $res
1445 eval vput addrcodec res d $res
1446 echo $?/$^ERRNAME $res
1447 vput addrcodec res +e 19 Hey\,\" <doog@def> "Wie
()" findet \" Dr. \" das?
1448 echo $?/$^ERRNAME $res
1449 eval vput addrcodec res d $res
1450 echo $?/$^ERRNAME $res
1452 vput addrcodec res ++e 20 Hey\,\" <doog@def> "Wie
()" findet \" Dr. \" das?
1453 echo $?/$^ERRNAME $res
1454 vput addrcodec res ++e 21 Hey\,\"" <doog@def
> "Wie()" findet
\" Dr.
\" das?
1455 echo $?
/$^ERRNAME
$res
1456 eval vput addrcodec res d
$res
1457 echo $?
/$^ERRNAME
$res
1459 vput addrcodec res
+++e
22 Hey\
,\" <doog@def
> "Wie()" findet
\" Dr.
\" das?
1460 echo $?
/$^ERRNAME
$res
1461 eval vput addrcodec res d
$res
1462 echo $?
/$^ERRNAME
$res
1464 vput addrcodec res s \
1465 "23 Hey\\,\\\" \"Wie" () "\" findet \\\" Dr. \\\" das?" <doog@def
>
1466 echo $?
/$^ERRNAME
$res
1468 #0/NONE 1 <doog@def>
1469 #0/NONE 1 <doog@def>
1470 #0/NONE "2 ." <doog@def>
1471 #0/NONE 2 . <doog@def>
1472 #0/NONE "3 Sauer Dr." <doog@def>
1473 #0/NONE 3 Sauer Dr. <doog@def>
1474 #0/NONE 3.50 "Sauer \(Ma\) Dr." <doog@def>
1475 #0/NONE 3.50 Sauer (Ma) Dr. <doog@def>
1476 #0/NONE 3.51 "Sauer \(Ma\) \"Dr.\"" <doog@def>
1477 #0/NONE 3.51 Sauer (Ma) "Dr." <doog@def>
1478 #0/NONE 4 Sauer (Ma) "Dr." <doog@def>
1479 #0/NONE 4 Sauer (Ma) Dr. <doog@def>
1480 #0/NONE 5 Sauer (Ma) "Braten Dr." <doog@def>
1481 #0/NONE 5 Sauer (Ma) Braten Dr. <doog@def>
1482 #0/NONE 6 Sauer (Ma) "Braten Dr." (Heu) <doog@def>
1483 #0/NONE 6 Sauer (Ma) Braten Dr. (Heu) <doog@def>
1484 #0/NONE 7 Sauer (Ma) "Braten Dr." (Heu bu) <doog@def>
1485 #0/NONE 7 Sauer (Ma) Braten Dr. (Heu bu) <doog@def>
1486 #0/NONE "8 Dr. Sauer" (Ma) "Braten Dr." (Heu bu) "Boom. Boom" <doog@def>
1487 #0/NONE 8 Dr. Sauer (Ma) Braten Dr. (Heu bu) Boom. Boom <doog@def>
1488 #0/NONE "9 Dr.Sauer" (Ma) "Braten Dr." (Heu) <doog@def>
1489 #0/NONE 9 Dr.Sauer (Ma) Braten Dr. (Heu) <doog@def>
1490 #0/NONE 10 (Ma) "Braten Dr." (Heu) <doog@def>
1491 #0/NONE 10 (Ma) Braten Dr. (Heu) <doog@def>
1492 #0/NONE 11 (Ma) "Braten Dr\".\"" (Heu) <doog@def>
1493 #0/NONE 11 (Ma) Braten Dr"." (Heu) <doog@def>
1494 #0/NONE "12 Dr. Sauer" (Ma) "Braten Dr." (u) <doog@def>
1495 #0/NONE 12 Dr. Sauer (Ma) Braten Dr. (u) <doog@def>
1496 #0/NONE 13 (Ma) "Braten Dr." (Heu) <doog@def>
1497 #0/NONE 13 (Ma) Braten Dr. (Heu) <doog@def>
1498 #0/NONE "14 Hey, Du Wie" () "findet Dr. das?" () <doog@def>
1499 #0/NONE 14 Hey, Du Wie () findet Dr. das? () <doog@def>
1500 #0/NONE "15 Hey, Du Wie" () "findet \"\" Dr. \"\" das?" () <doog@def>
1501 #0/NONE 15 Hey, Du Wie () findet "" Dr. "" das? () <doog@def>
1502 #0/NONE "16 \"Hey,\" \"Du\" \"Wie" () "\" findet \"\" Dr. \"\" das?" () <doog@def>
1503 #0/NONE 16 "Hey," "Du" "Wie () " findet "" Dr. "" das? () <doog@def>
1504 #0/NONE "17 \"Hey\" Du \"Wie" () "findet \" \" Dr. \"\"\" das?" () <doog@def>
1505 #0/NONE 17 "Hey" Du "Wie () findet " " Dr. """ das? () <doog@def>
1506 #0/NONE "18 \"Hey\" Du \"Wie" () "findet \" \" Dr. \"\"\" das?" () <doog@def>
1507 #0/NONE 18 "Hey" Du "Wie () findet " " Dr. """ das? () <doog@def>
1508 #0/NONE "19 Hey\\,\\\" \"Wie" () "\" findet \\\" Dr. \\\" das?" <doog@def>
1509 #0/NONE 19 Hey\,\" "Wie () " findet \" Dr. \" das? <doog@def>
1510 #1/INVAL 20 Hey\\,\\" <doog@def> "Wie()" findet \\" Dr. \\" das?
1511 #0/NONE "21 Hey\\,\\ Wie() findet \\ Dr. \\ das?" <doog@def>
1512 #0/NONE 21 Hey\,\ Wie() findet \ Dr. \ das? <doog@def>
1513 #0/NONE "22 Hey\,\" Wie() findet \" Dr. \" das?" <doog@def>
1514 #0/NONE 22 Hey," Wie() findet " Dr. " das? <doog@def>
1516 cksum_test behave
:addrcodec
"${MBOX}" '3907388894 2416'
1520 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} > "${MBOX}" 2>/dev/null
1521 vput vexpr res = 9223372036854775807
1522 echo $?/$^ERRNAME $res
1523 vput vexpr res = 9223372036854775808
1524 echo $?/$^ERRNAME $res
1525 vput vexpr res =@ 9223372036854775808
1526 echo $?/$^ERRNAME $res
1527 vput vexpr res = -9223372036854775808
1528 echo $?/$^ERRNAME $res
1529 vput vexpr res = -9223372036854775809
1530 echo $?/$^ERRNAME $res
1531 vput vexpr res =@ -9223372036854775809
1532 echo $?/$^ERRNAME $res
1535 echo $?/$^ERRNAME $res
1537 echo $?/$^ERRNAME $res
1539 echo $?/$^ERRNAME $res
1541 vput vexpr res + 0 0
1542 echo $?/$^ERRNAME $res
1543 vput vexpr res + 0 1
1544 echo $?/$^ERRNAME $res
1545 vput vexpr res + 1 1
1546 echo $?/$^ERRNAME $res
1548 vput vexpr res + 9223372036854775807 0
1549 echo $?/$^ERRNAME $res
1550 vput vexpr res + 9223372036854775807 1
1551 echo $?/$^ERRNAME $res
1552 vput vexpr res +@ 9223372036854775807 1
1553 echo $?/$^ERRNAME $res
1554 vput vexpr res + 0 9223372036854775807
1555 echo $?/$^ERRNAME $res
1556 vput vexpr res + 1 9223372036854775807
1557 echo $?/$^ERRNAME $res
1558 vput vexpr res +@ 1 9223372036854775807
1559 echo $?/$^ERRNAME $res
1561 vput vexpr res + -9223372036854775808 0
1562 echo $?/$^ERRNAME $res
1563 vput vexpr res + -9223372036854775808 -1
1564 echo $?/$^ERRNAME $res
1565 vput vexpr res +@ -9223372036854775808 -1
1566 echo $?/$^ERRNAME $res
1567 vput vexpr res + 0 -9223372036854775808
1568 echo $?/$^ERRNAME $res
1569 vput vexpr res + -1 -9223372036854775808
1570 echo $?/$^ERRNAME $res
1571 vput vexpr res +@ -1 -9223372036854775808
1572 echo $?/$^ERRNAME $res
1574 vput vexpr res - 0 0
1575 echo $?/$^ERRNAME $res
1576 vput vexpr res - 0 1
1577 echo $?/$^ERRNAME $res
1578 vput vexpr res - 1 1
1579 echo $?/$^ERRNAME $res
1581 vput vexpr res - 9223372036854775807 0
1582 echo $?/$^ERRNAME $res
1583 vput vexpr res - 9223372036854775807 -1
1584 echo $?/$^ERRNAME $res
1585 vput vexpr res -@ 9223372036854775807 -1
1586 echo $?/$^ERRNAME $res
1587 vput vexpr res - 0 9223372036854775807
1588 echo $?/$^ERRNAME $res
1589 vput vexpr res - -1 9223372036854775807
1590 echo $?/$^ERRNAME $res
1591 vput vexpr res - -2 9223372036854775807
1592 echo $?/$^ERRNAME $res
1593 vput vexpr res -@ -2 9223372036854775807
1594 echo $?/$^ERRNAME $res
1596 vput vexpr res - -9223372036854775808 +0
1597 echo $?/$^ERRNAME $res
1598 vput vexpr res - -9223372036854775808 +1
1599 echo $?/$^ERRNAME $res
1600 vput vexpr res -@ -9223372036854775808 +1
1601 echo $?/$^ERRNAME $res
1602 vput vexpr res - 0 -9223372036854775808
1603 echo $?/$^ERRNAME $res
1604 vput vexpr res - +1 -9223372036854775808
1605 echo $?/$^ERRNAME $res
1606 vput vexpr res -@ +1 -9223372036854775808
1607 echo $?/$^ERRNAME $res
1609 vput vexpr res + -13 -2
1610 echo $?/$^ERRNAME $res
1611 vput vexpr res - 0 0
1612 echo $?/$^ERRNAME $res
1613 vput vexpr res - 0 1
1614 echo $?/$^ERRNAME $res
1615 vput vexpr res - 1 1
1616 echo $?/$^ERRNAME $res
1617 vput vexpr res - -13 -2
1618 echo $?/$^ERRNAME $res
1620 vput vexpr res * 0 0
1621 echo $?/$^ERRNAME $res
1622 vput vexpr res * 0 1
1623 echo $?/$^ERRNAME $res
1624 vput vexpr res * 1 1
1625 echo $?/$^ERRNAME $res
1626 vput vexpr res * -13 -2
1627 echo $?/$^ERRNAME $res
1629 vput vexpr res / 0 0
1630 echo $?/$^ERRNAME $res
1631 vput vexpr res / 0 1
1632 echo $?/$^ERRNAME $res
1633 vput vexpr res / 1 1
1634 echo $?/$^ERRNAME $res
1635 vput vexpr res / -13 -2
1636 echo $?/$^ERRNAME $res
1638 vput vexpr res % 0 0
1639 echo $?/$^ERRNAME $res
1640 vput vexpr res % 0 1
1641 echo $?/$^ERRNAME $res
1642 vput vexpr res % 1 1
1643 echo $?/$^ERRNAME $res
1644 vput vexpr res % -13 -2
1645 echo $?/$^ERRNAME $res
1647 #0/NONE 9223372036854775807
1649 #0/OVERFLOW 9223372036854775807
1650 #0/NONE -9223372036854775808
1652 #0/OVERFLOW -9223372036854775808
1662 #0/NONE 9223372036854775807
1664 #0/OVERFLOW 9223372036854775807
1665 #0/NONE 9223372036854775807
1667 #0/OVERFLOW 9223372036854775807
1669 #0/NONE -9223372036854775808
1671 #0/OVERFLOW -9223372036854775808
1672 #0/NONE -9223372036854775808
1674 #0/OVERFLOW -9223372036854775808
1680 #0/NONE 9223372036854775807
1682 #0/OVERFLOW 9223372036854775807
1683 #0/NONE -9223372036854775807
1684 #0/NONE -9223372036854775808
1686 #0/OVERFLOW -9223372036854775808
1688 #0/NONE -9223372036854775808
1690 #0/OVERFLOW -9223372036854775808
1691 #0/NONE -9223372036854775808
1693 #0/OVERFLOW -9223372036854775808
1715 cksum_test behave:vexpr-numeric "${MBOX}" '1723609217 1048'
1717 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} > "${MBOX}" #2>/dev/null
1718 vput vexpr res
find 'bananarama' 'nana'
1719 echo $?
/$^ERRNAME
:$res:
1720 vput vexpr res
find 'bananarama' 'bana'
1721 echo $?
/$^ERRNAME
:$res:
1722 vput vexpr res
find 'bananarama' 'Bana'
1723 echo $?
/$^ERRNAME
:$res:
1724 vput vexpr res
find 'bananarama' 'rama'
1725 echo $?
/$^ERRNAME
:$res:
1727 vput vexpr res ifind
'bananarama' 'nana'
1728 echo $?
/$^ERRNAME
:$res:
1729 vput vexpr res ifind
'bananarama' 'bana'
1730 echo $?
/$^ERRNAME
:$res:
1731 vput vexpr res ifind
'bananarama' 'Bana'
1732 echo $?
/$^ERRNAME
:$res:
1733 vput vexpr res ifind
'bananarama' 'rama'
1734 echo $?
/$^ERRNAME
:$res:
1736 vput vexpr res substring
'bananarama' 1
1737 echo $?
/$^ERRNAME
:$res:
1738 vput vexpr res substring
'bananarama' 3
1739 echo $?
/$^ERRNAME
:$res:
1740 vput vexpr res substring
'bananarama' 5
1741 echo $?
/$^ERRNAME
:$res:
1742 vput vexpr res substring
'bananarama' 7
1743 echo $?
/$^ERRNAME
:$res:
1744 vput vexpr res substring
'bananarama' 9
1745 echo $?
/$^ERRNAME
:$res:
1746 vput vexpr res substring
'bananarama' 10
1747 echo $?
/$^ERRNAME
:$res:
1748 vput vexpr res substring
'bananarama' 1 3
1749 echo $?
/$^ERRNAME
:$res:
1750 vput vexpr res substring
'bananarama' 3 3
1751 echo $?
/$^ERRNAME
:$res:
1752 vput vexpr res substring
'bananarama' 5 3
1753 echo $?
/$^ERRNAME
:$res:
1754 vput vexpr res substring
'bananarama' 7 3
1755 echo $?
/$^ERRNAME
:$res:
1756 vput vexpr res substring
'bananarama' 9 3
1757 echo $?
/$^ERRNAME
:$res:
1758 vput vexpr res substring
'bananarama' 10 3
1759 echo $?
/$^ERRNAME
:$res:
1785 cksum_test behave
:vexpr-string
"${MBOX}" '265398700 267'
1787 if have_feat regex
; then
1788 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} > "${MBOX}" #2>/dev/null
1789 vput vexpr res regex 'bananarama' 'nana'
1790 echo $?/$^ERRNAME :$res:
1791 vput vexpr res regex 'bananarama' 'bana'
1792 echo $?/$^ERRNAME :$res:
1793 vput vexpr res regex 'bananarama' 'Bana'
1794 echo $?/$^ERRNAME :$res:
1795 vput vexpr res regex 'bananarama' 'rama'
1796 echo $?/$^ERRNAME :$res:
1798 vput vexpr res iregex 'bananarama' 'nana'
1799 echo $?/$^ERRNAME :$res:
1800 vput vexpr res iregex 'bananarama' 'bana'
1801 echo $?/$^ERRNAME :$res:
1802 vput vexpr res iregex 'bananarama' 'Bana'
1803 echo $?/$^ERRNAME :$res:
1804 vput vexpr res iregex 'bananarama' 'rama'
1805 echo $?/$^ERRNAME :$res:
1807 vput vexpr res regex 'bananarama' '(.*)nana(.*)' '\${1}a\${0}u{\$2}'
1808 echo $?/$^ERRNAME :$res:
1809 vput vexpr res regex 'bananarama' '(.*)bana(.*)' '\${1}a\${0}u\$2'
1810 echo $?/$^ERRNAME :$res:
1811 vput vexpr res regex 'bananarama' 'Bana(.+)' '\$1\$0'
1812 echo $?/$^ERRNAME :$res:
1813 vput vexpr res regex 'bananarama' '(.+)rama' '\$1\$0'
1814 echo $?/$^ERRNAME :$res:
1816 vput vexpr res iregex 'bananarama' '(.*)nana(.*)' '\${1}a\${0}u{\$2}'
1817 echo $?/$^ERRNAME :$res:
1818 vput vexpr res iregex 'bananarama' '(.*)bana(.*)' '\${1}a\${0}u\$2'
1819 echo $?/$^ERRNAME :$res:
1820 vput vexpr res iregex 'bananarama' 'Bana(.+)' '\$1\$0'
1821 echo $?/$^ERRNAME :$res:
1822 vput vexpr res iregex 'bananarama' '(.+)rama' '\$1\$0'
1823 echo $?/$^ERRNAME :$res:
1836 #0/NONE :baabananaramau{rama}:
1837 #0/NONE :abananaramaunarama:
1839 #0/NONE :bananabananarama:
1841 #0/NONE :baabananaramau{rama}:
1842 #0/NONE :abananaramaunarama:
1843 #0/NONE :naramabananarama:
1844 #0/NONE :bananabananarama:
1846 cksum_test behave:vexpr-regex "${MBOX}" '3270360157 311'
1850 t_behave_e_H_L_opts() {
1851 TRAP_EXIT_ADDONS=".
/.tsendmail.sh .
/.t.mbox
"
1854 "${SNAIL}" ${ARGS} -ef ./.t.mbox
1855 echo ${?} > "${MBOX}"
1857 ${cat} <<-_EOT > ./.tsendmail.sh
1859 (echo 'From Alchemilla Wed Apr 07 17:03:33 2017' && ${cat} && echo
1862 chmod 0755 ./.tsendmail.sh
1863 printf 'm me@exam.ple\nLine 1.\nHello.\n~.\n' |
1864 "${SNAIL}" ${ARGS} -Smta=./.tsendmail.sh
1865 printf 'm you@exam.ple\nLine 1.\nBye.\n~.\n' |
1866 "${SNAIL}" ${ARGS} -Smta=./.tsendmail.sh
1868 "${SNAIL}" ${ARGS} -ef ./.t.mbox
1869 echo ${?} >> "${MBOX}"
1870 "${SNAIL}" ${ARGS} -efL @t@me ./.t.mbox
1871 echo ${?} >> "${MBOX}"
1872 "${SNAIL}" ${ARGS} -efL @t@you ./.t.mbox
1873 echo ${?} >> "${MBOX}"
1874 "${SNAIL}" ${ARGS} -efL '@>@Line 1' ./.t.mbox
1875 echo ${?} >> "${MBOX}"
1876 "${SNAIL}" ${ARGS} -efL '@>@Hello.' ./.t.mbox
1877 echo ${?} >> "${MBOX}"
1878 "${SNAIL}" ${ARGS} -efL '@>@Bye.' ./.t.mbox
1879 echo ${?} >> "${MBOX}"
1880 "${SNAIL}" ${ARGS} -efL '@>@Good bye.' ./.t.mbox
1881 echo ${?} >> "${MBOX}"
1883 "${SNAIL}" ${ARGS} -fH ./.t.mbox >> "${MBOX}"
1884 echo ${?} >> "${MBOX}"
1885 "${SNAIL}" ${ARGS} -fL @t@me ./.t.mbox >> "${MBOX}"
1886 echo ${?} >> "${MBOX}"
1887 "${SNAIL}" ${ARGS} -fL @t@you ./.t.mbox >> "${MBOX}"
1888 echo ${?} >> "${MBOX}"
1889 "${SNAIL}" ${ARGS} -fL '@>@Line 1' ./.t.mbox >> "${MBOX}"
1890 echo ${?} >> "${MBOX}"
1891 "${SNAIL}" ${ARGS} -fL '@>@Hello.' ./.t.mbox >> "${MBOX}"
1892 echo ${?} >> "${MBOX}"
1893 "${SNAIL}" ${ARGS} -fL '@>@Bye.' ./.t.mbox >> "${MBOX}"
1894 echo ${?} >> "${MBOX}"
1895 "${SNAIL}" ${ARGS} -fL '@>@Good bye.' ./.t.mbox >> "${MBOX}" 2>/dev/null
1896 echo ${?} >> "${MBOX}"
1898 ${rm} -f ${TRAP_EXIT_ADDONS}
1909 #>N 1 Alchemilla 1996-10-02 01:50 7/112
1910 # N 2 Alchemilla 1996-10-02 01:50 7/111
1912 #>N 1 Alchemilla 1996-10-02 01:50 7/112
1914 # N 2 Alchemilla 1996-10-02 01:50 7/111
1916 #>N 1 Alchemilla 1996-10-02 01:50 7/112
1917 # N 2 Alchemilla 1996-10-02 01:50 7/111
1919 #>N 1 Alchemilla 1996-10-02 01:50 7/112
1921 # N 2 Alchemilla 1996-10-02 01:50 7/111
1924 cksum_test behave:e_H_L_opts "${MBOX}" '1708955574 678'
1927 t_behave_compose_hooks() {
1928 TRAP_EXIT_ADDONS=".
/.tsendmail.sh .
/.tnotes
"
1930 ${cat} <<-_EOT > ./.tsendmail.sh
1933 (echo 'From PrimulaVeris Wed Apr 10 22:59:00 2017' && ${cat}) > "${MBOX}"
1935 chmod 0755 ./.tsendmail.sh
1937 printf 'm hook-test@exam.ple\nbody\n~.\nvar t_oce t_ocs t_ocs_shell t_ocl' |
1938 "${SNAIL}" ${ARGS} \
1939 -Smta=./.tsendmail.sh \
1944 echo "~^header list
"; read hl; vput vexpr es substr "$hl" 0 1
1946 echoerr "Failed to header list
, aborting send
"; echo "~x
"
1948 echo "~^header insert cc splicy diet
<splice@exam.ple
> spliced
";\
1949 read es; vput vexpr es substr "$es" 0 1
1951 echoerr "Failed to be diet
, aborting send
"; echo "~x
"
1953 echo "~^header insert bcc juicy juice
<juice@exam.ple
> spliced
";\
1954 read es; vput vexpr es substr "$es" 0 1
1956 echoerr "Failed to be juicy
, aborting send
"; echo "~x
"
1961 set t_oce autobcc=oce@exam.ple
1964 set t_ocl autocc=ocl@exam.ple
1966 wysh set on-compose-splice=t_ocs \
1967 on-compose-splice-shell="read ver
;printf \"t_ocs-shell
\\n\
1968 ~t shell@exam.ple
\\n~
:set t_ocs_shell
\\n
\"" \
1969 on-compose-enter=t_oce on-compose-leave=t_ocl
1971 ${cat} ./.tnotes >> "${MBOX}"
1973 ${rm} -f ${TRAP_EXIT_ADDONS}
1976 #From PrimulaVeris Wed Apr 10 22:59:00 2017
1977 #Date: Wed, 02 Oct 1996 01:50:07 +0000
1978 #To: hook-test@exam.ple, shell@exam.ple
1979 #Cc: ocl@exam.ple, splicy diet spliced <splice@exam.ple>
1980 #Bcc: juicy juice spliced <juice@exam.ple>, oce@exam.ple
1985 ##variable not set: t_oce
1986 ##variable not set: t_ocs
1987 ##variable not set: t_ocs_shell
1988 ##variable not set: t_ocl
1989 cksum_test behave:compose_hooks "${MBOX}" '3240856112 319'
1992 t_behave_smime() { # FIXME add test/ dir, unroll tests therein
1993 TRAP_EXIT_ADDONS=".
/.t.conf .
/.tkey.pem .
/.tcert.pem .
/.tpair.pem
"
1994 TRAP_EXIT_ADDONS="${TRAP_EXIT_ADDONS} .
/.VERIFY .
/.DECRYPT .
/.ENCRYPT
"
1995 TRAP_EXIT_ADDONS="${TRAP_EXIT_ADDONS} .
/.tsendmail.sh
"
1997 printf 'behave:s/mime: .. generating test key and certificate ..\n'
1998 ${cat} <<-_EOT > ./.t.conf
2001 default_keyfile = keyfile.pem
2002 distinguished_name = req_distinguished_name
2003 attributes = req_attributes
2007 [ req_distinguished_name ]
2014 emailAddress = test@localhost
2019 openssl req -x509 -nodes -days 3650 -config ./.t.conf \
2020 -newkey rsa:1024 -keyout ./.tkey.pem -out ./.tcert.pem >/dev/null 2>&1
2021 ${cat} ./.tkey.pem ./.tcert.pem > ./.tpair.pem
2023 printf "behave
:s
/mime
:sign
/verify
: "
2024 echo bla | "${SNAIL}" ${ARGS} \
2025 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
2026 -Ssmime-sign -Sfrom=test@localhost \
2027 -s 'S/MIME test' ./.VERIFY
2028 printf 'verify\nx\n' |
2029 "${SNAIL}" ${ARGS} \
2030 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
2031 -Ssmime-sign -Sfrom=test@localhost \
2033 -f ./.VERIFY >/dev/null 2>&1
2034 if [ $? -eq 0 ]; then
2037 printf 'error: verification failed\n'
2039 ${rm} -f ${TRAP_EXIT_ADDONS}
2043 printf ' .. disproof via openssl smime(1): '
2044 if openssl smime -verify -CAfile ./.tcert.pem \
2045 -in ./.VERIFY >/dev/null 2>&1; then
2050 ${rm} -f ${TRAP_EXIT_ADDONS}
2055 # (signing +) encryption / decryption
2056 ${cat} <<-_EOT > ./.tsendmail.sh
2059 (echo 'From S-Postman Thu May 10 20:40:54 2012' && ${cat}) > ./.ENCRYPT
2061 chmod 0755 ./.tsendmail.sh
2063 printf "behave
:s
/mime
:encrypt
+sign
/decrypt
+verify
: "
2065 "${SNAIL}" ${ARGS} \
2066 -Ssmime-force-encryption \
2067 -Ssmime-encrypt-recei@ver.com=./.tpair.pem \
2068 -Smta=./.tsendmail.sh \
2069 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
2070 -Ssmime-sign -Sfrom=test@localhost \
2071 -s 'S/MIME test' recei@ver.com
2073 printf 'decrypt ./.DECRYPT\nfi ./.DECRYPT\nverify\nx\n' |
2074 "${SNAIL}" ${ARGS} \
2075 -Ssmime-force-encryption \
2076 -Ssmime-encrypt-recei@ver.com=./.tpair.pem \
2077 -Smta=./.tsendmail.sh \
2078 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
2079 -Ssmime-sign -Sfrom=test@localhost \
2081 -f ./.ENCRYPT >/dev/null 2>&1
2082 if [ $? -eq 0 ]; then
2086 printf 'error: decryption+verification failed\n'
2088 printf ' ..disproof via openssl smime(1): '
2089 if (openssl smime -decrypt -inkey ./.tkey.pem -in ./.ENCRYPT |
2090 openssl smime -verify -CAfile ./.tcert.pem) >/dev/null 2>&1; then
2096 ${sed} -e '/^Date:/d' -e '/^X-Decoding-Date/d' \
2098 '/^Content-Disposition: attachment; filename="smime.p7s
"/,/^-- /d' \
2099 < ./.DECRYPT > ./.ENCRYPT
2100 cksum_test ".. checksum of decrypted content
" ".
/.ENCRYPT
" '3090916509 510'
2102 printf "behave
:s
/mime
:encrypt
/decrypt
: "
2104 echo bla | "${SNAIL}" ${ARGS} \
2105 -Ssmime-force-encryption \
2106 -Ssmime-encrypt-recei@ver.com=./.tpair.pem \
2107 -Smta=./.tsendmail.sh \
2108 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
2109 -Sfrom=test@localhost \
2110 -s 'S/MIME test' recei@ver.com
2111 printf 'decrypt ./.DECRYPT\nx\n' | "${SNAIL}" ${ARGS} \
2112 -Ssmime-force-encryption \
2113 -Ssmime-encrypt-recei@ver.com=./.tpair.pem \
2114 -Smta=./.tsendmail.sh \
2115 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
2116 -Sfrom=test@localhost \
2118 -f ./.ENCRYPT >/dev/null 2>&1
2119 if [ $? -eq 0 ]; then
2123 printf 'error: decryption failed\n'
2125 printf '.. disproof via openssl smime(1): '
2126 if openssl smime -decrypt -inkey ./.tkey.pem \
2127 -in ./.ENCRYPT >/dev/null 2>&1; then
2133 ${sed} -e '/^Date:/d' -e '/^X-Decoding-Date/d' \
2134 < ./.DECRYPT > ./.ENCRYPT
2135 cksum_test ".. checksum of decrypted content
" ./.ENCRYPT '999887248 295'
2137 ${rm} -f ${TRAP_EXIT_ADDONS}
2142 # Some basic tests regarding correct sending of mails, via STDIN / -t / -q,
2143 # including basic MIME Content-Transfer-Encoding correctness (quoted-printable)
2144 # Note we unfortunately need to place some statements without proper
2145 # indentation because of continuation problems
2147 # MIME encoding (QP) stress message body
2149 'Ich bin eine DÖS-Datäi mit sehr langen Zeilen und auch '\
2150 'sonst bin ich ganz schön am Schleudern, da kannste denke '\
2151 "wasde willst
, gelle
, gelle
, gelle
, gelle
, gelle.
\r\n"\
2152 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
\r\n"\
2153 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
1\r\n"\
2154 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
12\r\n"\
2155 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
123\r\n"\
2156 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
1234\r\n"\
2157 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
12345\r\n"\
2158 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
123456\r\n"\
2159 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
1234567\r\n"\
2160 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
12345678\r\n"\
2161 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
123456789\r\n"\
2162 "Unn ausserdem habe ich trailing SP
/HT
/SP
/HT whitespace
\r\n"\
2163 "Unn ausserdem habe ich trailing HT
/SP
/HT
/SP whitespace
\r\n"\
2164 "auf den zeilen vorher.
\r\n"\
2165 "From am Zeilenbeginn und From der Mitte gibt es auch.
\r\n"\
2167 "Die letzte Zeile war nur ein Punkt.
\r\n"\
2169 "Das waren deren zwei.
\r\n"\
2171 "Die letzte Zeile war ein Leerschritt.
\n"\
2172 "=VIER
= EQUAL SIGNS
=ON A LINE
=\r\n"\
2175 "Die letzte Zeile war nur ein Punkt
, mit Unix Zeilenende.
\n"\
2177 "Das waren deren zwei. ditto.
\n"\
2179 "Unn ausseerdem habe ich trailing SP
/HT
/SP
/HT whitespace
\n"\
2180 "Unn ausseerdem habe ich trailing HT
/SP
/HT
/SP whitespace
\n"\
2181 "auf den zeilen vorher.
\n"\
2183 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende.
\n"\
2184 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.1"\
2186 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.12"\
2188 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.12"\
2190 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.12"\
2192 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.12"\
2194 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.12"\
2196 "QP am Zeilenende über soft-nl hinweg
\n"\
2197 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende.
"\
2199 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende.
"\
2201 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende.
"\
2203 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende.
"\
2205 "=VIER
= EQUAL SIGNS
=ON A LINE
=\n"\
2207 "Die letzte Zeile war ein Leerschritt.
\n"\
2211 # MIME encoding (QP) stress message subject
2212 SUB="Äbrä Kä?dä
=brö Fü?di
=bus? \
2213 adadaddsssssssddddddddddddddddddddd\
2214 ddddddddddddddddddddddddddddddddddd\
2215 ddddddddddddddddddddddddddddddddddd\
2216 dddddddddddddddddddd Hallelulja? Od\
2217 er?? eeeeeeeeeeeeeeeeeeeeeeeeeeeeee\
2218 eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\
2219 eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee f\
2220 fffffffffffffffffffffffffffffffffff\
2221 fffffffffffffffffffff ggggggggggggg\
2222 ggggggggggggggggggggggggggggggggggg\
2223 ggggggggggggggggggggggggggggggggggg\
2224 ggggggggggggggggggggggggggggggggggg\
2227 # Three tests for MIME encodign and (a bit) content classification.
2228 # At the same time testing -q FILE, < FILE and -t FILE
2231 < "${BODY}" "${SNAIL}" ${ARGS} ${ADDARG_UNI} \
2232 -a "${BODY}" -s "${SUB}" "${MBOX}"
2233 cksum_test content
:001 "${MBOX}" '2356108758 6413'
2236 < /dev
/null
"${SNAIL}" ${ARGS} ${ADDARG_UNI} \
2237 -a "${BODY}" -s "${SUB}" -q "${BODY}" "${MBOX}"
2238 cksum_test content:002 "${MBOX}" '2356108758 6413'
2241 ( echo "To
: ${MBOX}" && echo "Subject
: ${SUB}" && echo &&
2243 ) | "${SNAIL}" ${ARGS} ${ADDARG_UNI} -Snodot -a "${BODY}" -t
2244 cksum_test content:003 "${MBOX}" '2356108758 6413'
2246 # Test for [260e19d] (Juergen Daubert)
2248 echo body | "${SNAIL}" ${ARGS} "${MBOX}"
2249 cksum_test content:004 "${MBOX}" '4004005686 49'
2251 # Sending of multiple mails in a single invocation
2253 ( printf "m
${MBOX}\n~s subject1
\nE
-Mail Körper
1\n~.
\n" &&
2254 printf "m
${MBOX}\n~s subject2
\nEmail body
2\n~.
\n" &&
2256 ) | "${SNAIL}" ${ARGS} ${ADDARG_UNI}
2257 cksum_test content
:005 "${MBOX}" '2157252578 260'
2261 # "Test for" [d6f316a] (Gavin Troy)
2263 printf "m ${MBOX}\n~s subject1\nEmail body\n~.\nfi ${MBOX}\np\nx\n" |
2264 "${SNAIL}" ${ARGS} ${ADDARG_UNI} -Spipe-text/plain="${cat}" > "${BODY}"
2265 ${sed} -e 1d < "${BODY}" > "${MBOX}"
2266 cksum_test content:006 "${MBOX}" '2273863401 83'
2268 # "Test
for" [c299c45] (Peter Hofmann) TODO shouldn't end up QP-encoded?
2271 for(i = 0; i < 10000; ++i)
2273 #printf "\xF0\x90\x87\x90"
2274 }' | "${SNAIL}" ${ARGS} ${ADDARG_UNI} -s TestSubject "${MBOX}"
2275 cksum_test content:007 "${MBOX}" '1754234717 61767'
2277 ## Test some more corner cases for header bodies (as good as we can today) ##
2281 echo | "${SNAIL}" ${ARGS} ${ADDARG_UNI} \
2282 -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̲' \
2284 cksum_test content
:008 "${MBOX}" '1563381297 326'
2286 # Single word (overlong line split -- bad standard! Requires injection of
2287 # artificial data!! Bad can be prevented by using RFC 2047 encoding)
2289 i
=`${awk} 'BEGIN{for(i=0; i<92; ++i) printf "0123456789_"}'`
2290 echo |
"${SNAIL}" ${ARGS} -s "${i}" "${MBOX}"
2291 cksum_test content
:009 "${MBOX}" '1996714851 1669'
2293 # Combination of encoded words, space and tabs of varying sort
2295 echo |
"${SNAIL}" ${ARGS} ${ADDARG_UNI} \
2296 -s "1Abrä Kaspas1
2Abra Katä b_kaspas2 \
2297 3Abrä Kaspas3
4Abrä Kaspas4
5Abrä Kaspas5 \
2298 6Abra Kaspas6
7Abrä Kaspas7
8Abra Kaspas8 \
2299 9Abra Kaspastäb4-3
10Abra Kaspas1 _
11Abra Katäb1 \
2300 12Abra Kadabrä
1 After Tab after Täb this is NUTS
" \
2302 cksum_test content:010 "${MBOX}" '2956039469 542'
2304 # Overlong multibyte sequence that must be forcefully split
2305 # todo This works even before v15.0, but only by accident
2307 echo | "${SNAIL}" ${ARGS} ${ADDARG_UNI} \
2308 -s "✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄\
2309 ✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄\
2310 ✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄" \
2312 cksum_test content
:011 "${MBOX}" '454973928 610'
2316 echo |
"${SNAIL}" ${ARGS} \
2317 -s "1-1 B2 B3 B4 B5 B6 B\
2318 1-2 B2 B3 B4 B5 B6 B\
2319 1-3 B2 B3 B4 B5 B6 B\
2320 1-4 B2 B3 B4 B5 B6 B\
2321 1-5 B2 B3 B4 B5 B6 B\
2322 1-6 B2 B3 B4 B5 B6 " \
2324 cksum_test content
:012 "${MBOX}" '1014122962 248'
2326 # Leading and trailing WS
2328 echo |
"${SNAIL}" ${ARGS} \
2329 -s " 2-1 B2 B3 B4 B5 B6 B\
2330 1-2 B2 B3 B4 B5 B6 B\
2331 1-3 B2 B3 B4 B5 B6 B\
2332 1-4 B2 B3 B4 B5 B6 " \
2334 cksum_test content
:013 "${MBOX}" '3212167908 187'
2336 # Quick'n dirty RFC 2231 test; i had more when implementing it, but until we
2337 # have a (better) test framework materialize a quick shot
2339 TRAP_EXIT_ADDONS
=.
/.ttt
2341 mkdir .
/.ttt ||
exit 1
2345 : > 'diet\ is \curd.txt'
2346 : > 'diet "is" curd.txt'
2348 : > 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
2349 : > höde__tröge__müde__dätte__hätte__vuelle__guelle__aese__aesse__sauerliche__kräuter__österliche__grüße__mäh.txt
2350 : > hööööööööööööööööö_nöööööööööööööööööööööö_düüüüüüüüüüüüüüüüüüü_bäääääääääääääääääääääääh.txt
2351 : > ✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆.txt
2353 echo bla |
"${SNAIL}" ${ARGS} ${ADDARG_UNI} \
2354 -a ".
/.ttt
/ma
'ger.txt" -a "./.ttt/mä'ger.txt
" \
2355 -a './.ttt/diet\ is \curd.txt' -a './.ttt/diet "is
" curd.txt' \
2356 -a ./.ttt/höde-tröge.txt \
2357 -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 \
2358 -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 \
2359 -a ./.ttt/hööööööööööööööööö_nöööööööööööööööööööööö_düüüüüüüüüüüüüüüüüüü_bäääääääääääääääääääääääh.txt \
2360 -a ./.ttt/✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆.txt \
2363 cksum_test content:14 "${MBOX}" '589846634 2491'
2365 printf "Resend
${BODY}\nx\n" | "${SNAIL}" ${ARGS} -f "${MBOX}"
2366 cksum_test content:14-2 "${MBOX}" '589846634 2491'
2370 if have_feat devel; then
2371 ARGS="${ARGS} -Smemdebug"
2378 if [ -z "${CHECK_ONLY}" ]; then
2384 [ ${ESTAT} -eq 0 ] && echo Ok || echo >&2 'Errors occurred'