2 #@ Usage: ./cc-test.sh [--check-only [s-nail-binary]]
5 ARGS
='-:/ -# -Sdotlock-ignore-error -Sencoding=quoted-printable -Sstealthmua'
6 ARGS
="${ARGS}"' -Snosave -Sexpandaddr=restrict'
7 ARGS
="${ARGS}"' -Slog-prefix=classico:'
12 #UTF8_LOCALE= autodetected unless set
14 if ( command -v command ) >/dev
/null
2>&1; then :; else
21 MAKE
="${MAKE:-`command -v make`}"
22 awk=${awk:-`command -v awk`}
23 cat=${cat:-`command -v cat`}
24 cksum=${cksum:-`command -v cksum`}
25 rm=${rm:-`command -v rm`}
26 sed=${sed:-`command -v sed`}
27 grep=${grep:-`command -v grep`}
31 export SNAIL ARGS CONF BODY MBOX MAIL MAKE
awk cat cksum rm sed grep
33 LC_ALL
=C LANG
=C ADDARG_UNI
=-Sttycharset=UTF-8
35 # Wed Oct 2 01:50:07 UTC 1996
36 SOURCE_DATE_EPOCH
=844221007
38 export LC_ALL LANG ADDARG_UNI TZ SOURCE_DATE_EPOCH
41 # Problem: force $SHELL to be a real shell. It seems some testing environments
42 # use nologin(?), but we need a real shell for command execution
43 if { echo ${SHELL} | ${grep} nologin; } >/dev
/null
2>&1; then
44 echo >&2 '$SHELL seems to be nologin, overwriting to /bin/sh!'
49 if [ -z "${UTF8_LOCALE}" ]; then
51 if command -v locale
>/dev
/null
2>&1; then
52 UTF8_LOCALE
=`locale -a | { m=
54 if { echo ${n} | ${grep} -i 'utf-\{0,1\}8'; } >/dev/null 2>&1; then
56 if { echo ${n} | ${grep} -e POSIX -e en_EN -e en_US; }; then
70 echo >&2 "Usage: ./cc-test.sh [--check-only [s-nail-binary]]"
76 [ "${1}" = --check-only ] || usage
77 [ ${#} -gt 2 ] && usage
78 [ ${#} -eq 2 ] && SNAIL
="${2}"
79 [ -x "${SNAIL}" ] || usage
84 trap "${rm} -rf \"${BODY}\" \"${MBOX}\" \${TRAP_EXIT_ADDONS}" EXIT
85 trap "exit 1" HUP INT TERM
88 # Test all configs TODO doesn't cover all *combinations*, stupid!
92 NOTME["OPT_AUTOCC"] = 1
93 NOTME["OPT_DEBUG"] = 1
94 NOTME["OPT_DEVEL"] = 1
95 NOTME["OPT_NOEXTMD5"] = 1
96 NOTME["OPT_NOMEMDBG"] = 1
100 /^[[:space:]]*OPT_/ {
101 sub(/^[[:space:]]*/, "")
102 # This bails for UnixWare 7.1.4 awk(1), but preceeding = with \
103 # does not seem to be a compliant escape for =
105 $1 = substr($1, 1, index($1, "=") - 1)
111 # Doing this completely sequentially and not doing make distclean in
112 # between runs should effectively result in lesser compilations.
113 # It is completely dumb nonetheless... TODO
114 for (j = 1; j < i; ++j) {
115 for (k = 1; k < j; ++k)
117 for (k = j; k < i; ++k)
119 printf "OPT_AUTOCC=1\n"
121 for (j = 1; j < i; ++j) {
122 for (k = 1; k < j; ++k)
124 for (k = j; k < i; ++k)
126 printf "OPT_AUTOCC=1\n"
129 for (j = 1; j < i; ++j) {
130 for (k = 1; k < j; ++k)
132 for (k = j; k < i; ++k)
134 printf "OPT_AUTOCC=1\n"
135 printf "OPT_DEBUG=1\n"
137 for (j = 1; j < i; ++j) {
138 for (k = 1; k < j; ++k)
140 for (k = j; k < i; ++k)
142 printf "OPT_AUTOCC=1\n"
143 printf "OPT_DEBUG=1\n"
146 printf "CONFIG=NULL OPT_AUTOCC=0\n"
147 printf "CONFIG=NULL OPT_AUTOCC=1\n"
148 printf "CONFIG=NULLI OPT_AUTOCC=0\n"
149 printf "CONFIG=NULLI OPT_AUTOCC=1\n"
150 printf "CONFIG=MINIMAL OPT_AUTOCC=0\n"
151 printf "CONFIG=MINIMAL OPT_AUTOCC=1\n"
152 printf "CONFIG=MEDIUM OPT_AUTOCC=0\n"
153 printf "CONFIG=MEDIUM OPT_AUTOCC=1\n"
154 printf "CONFIG=NETSEND OPT_AUTOCC=0\n"
155 printf "CONFIG=NETSEND OPT_AUTOCC=1\n"
156 printf "CONFIG=MAXIMAL OPT_AUTOCC=0\n"
157 printf "CONFIG=MAXIMAL OPT_AUTOCC=1\n"
158 printf "CONFIG=DEVEL OPT_AUTOCC=0\n"
159 printf "CONFIG=DEVEL OPT_AUTOCC=1\n"
160 printf "CONFIG=ODEVEL OPT_AUTOCC=0\n"
161 printf "CONFIG=ODEVEL OPT_AUTOCC=1\n"
164 printf "\n\n##########\n$c\n"
165 printf "\n\n##########\n$c\n" >&2
173 # Read mailbox $2, strip non-constant headers and MIME boundaries, query the
174 # cksum(1) of the resulting data and compare against the checksum $3
176 tid
=${1} f=${2} s=${3}
178 csum
="`${sed} -e '/^From /d' \
179 -e '/^ boundary=/d' -e '/^--=-=/d' < \"${f}\" \
180 -e '/^\[-- Message/d' | ${cksum}`";
181 if [ "${csum}" = "${s}" ]; then
185 printf 'error: checksum mismatch (got %s)\n' "${csum}"
191 printf '%s: error: %s\n' ${1} "${2}"
195 [ $?
-ne 0 ] && err
$1 'unexpected non-0 exit status'
199 [ $?
-eq 0 ] && err
$1 'unexpected 0 exit status'
203 ( "${SNAIL}" ${ARGS} -X'echo $features' -Xx | ${grep} +${1} ) >/dev/null 2>&1
207 # Basic (easily testable) behaviour tests
209 t_behave_X_opt_input_command_stack
212 t_behave_input_inject_semicolon_seq
213 t_behave_commandalias
216 t_behave_macro_param_shift
222 # FIXME t_behave_alias
224 # FIXME t_behave_mlist
226 have_feat smime && t_behave_smime
229 t_behave_compose_hooks
232 t_behave_X_opt_input_command_stack() {
233 ${cat} <<- '__EOT' > "${BODY}"
241 echo "define mac1
{";\
242 echo " echo mac1-1 via1 \
$0";\
244 echo " echo mac1-2
";\
246 echo " echo mac1-3
";\
249 echo "define mac2
{";\
250 echo " echo mac2-1 via1 \
$0";\
252 echo " echo mac2-2
";\
258 echo echo 1-1-1 via1 \
$0;\
270 # The -X option supports multiline arguments, and those can internally use
271 # reverse solidus newline escaping. And all -X options are joined...
273 < "${BODY}" "${SNAIL}" ${ARGS} \
288 echo "define mac1 {";\
289 echo " echo mac1-1 via2 \$0";\
291 echo " echo mac1-2";\
293 echo " echo mac1-3";\
296 echo "define mac2 {";\
297 echo " echo mac2-1 via2 \$0";\
299 echo " echo mac2-2";\
305 echo echo 1-1-1 via2 \$0;\
317 ' > "${MBOX}" 2>/dev
/null
362 ex0_test behave
:x_opt_input_command_stack
363 cksum_test behave
:x_opt_input_command_stack
"${MBOX}" '1391275936 378'
366 t_behave_X_errexit
() {
367 ${cat} <<- '__EOT' > "${BODY}"
373 </dev/null "${SNAIL}" ${ARGS} -Snomemdebug \
374 -X'echo one' -X' echos nono ' -X'echo two' \
377 #classico:Unknown command: `echos'
379 ex0_test behave:x_errexit-1
380 cksum_test behave:x_errexit-1 "${MBOX}" '2893507350 42'
382 </dev/null "${SNAIL}" ${ARGS} -X'source '"${BODY}" -Snomemdebug \
384 ex0_test behave:x_errexit-2
385 cksum_test behave:x_errexit-2 "${MBOX}" '2893507350 42'
387 </dev/null MAILRC="${BODY}" "${SNAIL}" ${ARGS} -:u
-Snomemdebug \
389 ex0_test behave
:x_errexit-3
390 cksum_test behave
:x_errexit-3
"${MBOX}" '2893507350 42'
394 </dev
/null
"${SNAIL}" ${ARGS} -Serrexit -Snomemdebug \
395 -X'echo one' -X' echos nono ' -X'echo two' \
398 #classico:Unknown command: `echos'
399 exn0_test behave
:x_errexit-4
400 cksum_test behave
:x_errexit-4
"${MBOX}" '3287572983 38'
402 </dev
/null
"${SNAIL}" ${ARGS} -X'source '"${BODY}" -Serrexit -Snomemdebug \
404 exn0_test behave
:x_errexit-5
405 cksum_test behave
:x_errexit-5
"${MBOX}" '3287572983 38'
407 </dev
/null MAILRC
="${BODY}" "${SNAIL}" ${ARGS} -:u -Serrexit -Snomemdebug \
410 #classico:Unknown command: `echos'
411 #classico:Alert: Stopped loading initialization resource ./.cc-body.txt due to errors (enable *debug* for trace)
412 exn0_test behave:x_errexit-6
413 cksum_test behave:x_errexit-6 "${MBOX}" '2718843754 150'
415 </dev/null MAILRC="${BODY}" "${SNAIL}" ${ARGS} -:u
-Sposix -Snomemdebug \
417 exn0_test behave
:x_errexit-7
418 cksum_test behave
:x_errexit-7
"${MBOX}" '2718843754 150'
420 ## Repeat 4-7 with ignerr set
422 ${sed} -e 's/^echos /ignerr echos /' < "${BODY}" > "${MBOX}"
424 </dev/null "${SNAIL}" ${ARGS} -Serrexit -Snomemdebug \
425 -X'echo one' -X'ignerr echos nono ' -X'echo two' \
427 ex0_test behave:x_errexit-8
428 cksum_test behave:x_errexit-8 "${BODY}" '2893507350 42'
430 </dev/null "${SNAIL}" ${ARGS} -X'source '"${MBOX}" -Serrexit -Snomemdebug \
432 ex0_test behave:x_errexit-9
433 cksum_test behave:x_errexit-9 "${BODY}" '2893507350 42'
435 </dev/null MAILRC="${MBOX}" "${SNAIL}" ${ARGS} -:u
-Serrexit -Snomemdebug \
437 ex0_test behave
:x_errexit-10
438 cksum_test behave
:x_errexit-10
"${BODY}" '2893507350 42'
440 </dev
/null MAILRC
="${MBOX}" "${SNAIL}" ${ARGS} -:u -Sposix -Snomemdebug \
442 ex0_test behave:x_errexit-11
443 cksum_test behave:x_errexit-11 "${BODY}" '2893507350 42'
447 ${cat} <<- '__EOT' > "${BODY}"
466 echo 'a${DIET}b${TIED}c\${DIET}d\${TIED}e' # COMMENT
467 echo "a${DIET}b${TIED}c\${DIET}d\${TIED}e"
468 echo $
'a${DIET}b${TIED}c\${DIET}d\${TIED}e'
470 echo a$
'\101\0101\x41\u0041\u41\U00000041\U41'c
471 echo a$
'\u0041\u41\u0C1\U00000041\U41'c
494 echo a$
'b\U0000000'dt
495 echo a$
'b\U00000000'du
505 if [ -z "${UTF8_LOCALE}" ]; then
506 echo 'Skip behave:wysh_unicode, no UTF8_LOCALE'
508 < "${BODY}" DIET
=CURD TIED
= \
509 LC_ALL
=${UTF8_LOCALE} "${SNAIL}" ${ARGS} 2>/dev/null > "${MBOX}"
525 #a${DIET}b${TIED}c\${DIET}d\${TIED}e
526 #aCURDbc${DIET}d${TIED}e
527 #a${DIET}b${TIED}cCURDde
556 ex0_test behave
:wysh_unicode
557 cksum_test behave
:wysh_unicode
"${MBOX}" '475805847 317'
560 < "${BODY}" DIET=CURD TIED= "${SNAIL}" ${ARGS} > "${MBOX}" 2>/dev
/null
576 #a${DIET}b${TIED}c\${DIET}d\${TIED}e
577 #aCURDbc${DIET}d${TIED}e
578 #a${DIET}b${TIED}cCURDde
607 ex0_test behave
:wysh_c
608 cksum_test behave
:wysh_c
"${MBOX}" '1473887148 321'
611 t_behave_input_inject_semicolon_seq
() {
612 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} > "${MBOX}"
617 echon this_is_mymac;call mydeepmac;echon ';';
619 echon one';';~mymac;echon two";";call mymac;echo three$';';
621 echon this_is_mymac;call mydeepmac;echon ,TOO'!;';
623 echon one';';~mymac;echon two";";call mymac;echo three$';';
625 #one;this_is_mymac(mydeepmac);two;this_is_mymac(mydeepmac);three;
626 #one;this_is_mymac(mydeepmac),TOO!;two;this_is_mymac(mydeepmac),TOO!;three;
627 ex0_test behave:input_inject_semicolon_seq
628 cksum_test behave:input_inject_semicolon_seq "${MBOX}" '512117110 140'
631 t_behave_commandalias() {
632 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} > "${MBOX}"
633 commandalias
echo echo hoho
637 commandalias XxX XxXx
638 commandalias XxXx XxXxX
639 commandalias XxXxX XxXxXx
640 commandalias XxXxXx
echo huhu
641 commandalias XxXxXxX
echo huhu
643 commandalias XxXxXx XxXxXxX
646 commandalias XxXxXx
echo huhu
653 ex0_test behave
:commandalias
654 cksum_test behave
:commandalias
"${MBOX}" '3694143612 31'
658 # Nestable conditions test
659 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} > "${MBOX}"
681 if $dietcurd == 'yoho'
686 if $dietcurd != 'yoho'
747 if $dietcurd == 'yohu'
749 elif $dietcurd == 'yoha'
751 elif $dietcurd == 'yohe'
753 elif $dietcurd == 'yoho'
755 if $dietcurd == 'yohu'
757 elif $dietcurd == 'yoha'
759 elif $dietcurd == 'yohe'
761 elif $dietcurd == 'yoho'
763 if $dietcurd == 'yohu'
765 elif $dietcurd == 'yoha'
767 elif $dietcurd == 'yohe'
769 elif $dietcurd == 'yoho'
780 # integer conversion, <..>..
883 set diet=abc curd=abc
889 set diet=abc curd=abcd
895 # 1. Shitty grouping capabilities as of today
896 unset diet curd ndefined
897 if [ [ false ] || [ false ] || [ true ] ] && [ [ false ] || [ true ] ] && \
903 if [ [ [ [ 0 ] || [ 1 ] ] && [ [ 1 ] || [ 0 ] ] ] && [ 1 ] ] && [ yes ]
908 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] ]
913 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] ]
918 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] || [ 1 ] ] && [ no ]
923 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] || [ 1 ] ] \
929 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 1 ] ]
934 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 0 ] ]
939 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 0 ] ] && [ 1 ] ] ] && [ 1 ] ]
944 if [ [ [ [ [ [ [ 0 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 1 ] ]
949 if [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] && [ 0 ]
954 if [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] && [ 1 ]
959 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ]
964 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 1 ]
969 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ] || [ 1 ] && [ 0 ]
974 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ] || [ 1 ] && [ 1 ]
980 if [ [ $diet == 'yo' ] && [ $curd == 'ho' ] ] && [ $ndefined ]
986 if [ [ $diet == 'yo' ] && [ $curd == 'ho' ] ] && [ $ndefined ]
991 # 2. Shitty grouping capabilities as of today
992 unset diet curd ndefined
993 if [ false || false || true ] && [ false || true ] && yes
998 if [ [ [ 0 || 1 ] && [ 1 || 0 ] ] && 1 ] && [ yes ]
1003 if [ 1 || 0 || 0 || 0 ]
1008 if [ 1 || 0 || 0 || 0 || [ 1 ] ]
1013 if [ 1 || 0 || 0 || 0 || [ 1 ] || 1 ] && no
1018 if [ 1 || 0 || 0 || 0 || 1 || [ 1 ] ] && no || [ yes ]
1023 if [ [ [ [ [ [ 1 ] && 1 ] && 1 ] && 1 ] ] && [ 1 ] ]
1028 if [ [ [ [ [ [ 1 ] && 1 ] && 1 ] && [ 1 ] ] ] && 0 ]
1033 if [ [ [ [ [ [ [ 1 ] ] && 1 ] && 0 ] && [ 1 ] ] ] && 1 ]
1038 if [ [ [ [ [ [ 0 ] && 1 ] && 1 ] && 1 ] ] && 1 ]
1043 if 1 || 0 || 0 || 0 && 0
1048 if 1 || 0 || 0 || 0 && 1
1053 if 0 || 0 || 0 || 1 && 0
1058 if 0 || 0 || 0 || 1 && 1
1063 if 0 || 0 || 0 || 1 && 0 || 1 && 0
1068 if 0 || 0 || 0 || 1 && 0 || 1 && 1
1074 if [ $diet == 'yo' && $curd == 'ho' ] && $ndefined
1079 if $diet == 'yo' && $curd == 'ho' && $ndefined
1085 if [ $diet == 'yo' && $curd == 'ho' ] && $ndefined
1090 if $diet == 'yo' && $curd == 'ho' && $ndefined
1095 if [ [ [ [ [ [ $diet == 'yo' && $curd == 'ho' && $ndefined ] ] ] ] ] ]
1100 # Some more en-braced variables
1102 if ${diet} == ${curd}
1107 if ${diet} != ${curd}
1123 if ! 0 && ! ! 1 && ! ! ! ! 2 && 3
1128 if ! 0 && ! [ ! 1 ] && ! [ ! [ ! [ ! 2 ] ] ] && 3
1133 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
1138 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && ! 3
1143 if [ ! 0 ] && [ ! [ ! 1 ] ] && ! [ [ ! [ ! [ ! [ 2 ] ] ] ] ] && ! 3
1148 if [ ! 0 ] && ! [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
1153 if ! [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
1158 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] || 3
1163 if [ ! 0 ] && [ ! ! [ ! ! 1 ] ] && [ ! ! [ ! ! [ ! ! [ ! ! [ 2 ] ] ] ] ]
1169 if ! 0 && ! ! 1 && ! ! ! 0 && 3
1174 if ! 0 && ! [ ! 1 ] && ! [ ! [ ! [ 0 ] ] ] && 3
1179 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ [ 0 ] ] ] ] ] && 3
1184 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! ! [ ! [ ! 0 ] ] ] ] && ! 3
1189 if [ ! 0 ] && [ ! [ ! 1 ] ] && ! [ ! [ ! [ ! [ ! 0 ] ] ] ] && 3
1194 if [ ! 0 ] && ! [ ! [ ! 1 ] ] && [ ! ! [ ! [ ! [ ! [ 0 ] ] ] ] ] && 3
1199 if ! [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! ! 0 ] ] ] ] && 3
1204 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ ! 0 ] ] ] ] ] || 3
1209 if [ ! 0 ] && [ ! ! [ ! ! 1 ] ] && [ ! ! [ ! ! [ ! ! [ ! [ 0 ] ] ] ] ]
1215 ex0_test behave:if-normal
1216 cksum_test behave:if-normal "${MBOX}" '557629289 631'
1218 if have_feat regex; then
1219 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} > "${MBOX}"
1221 if $dietcurd =~
'^yo.*'
1226 if $dietcurd =~
'^yoho.+'
1231 if $dietcurd !~
'.*ho$'
1236 if $dietcurd !~
'.+yoho$'
1241 if [ $dietcurd !~
'.+yoho$' ]
1246 if ! [ $dietcurd =~
'.+yoho$' ]
1251 if ! ! [ $dietcurd !~
'.+yoho$' ]
1256 if ! [ ! [ $dietcurd !~
'.+yoho$' ] ]
1261 if [ ! [ ! [ $dietcurd !~
'.+yoho$' ] ] ]
1266 if ! [ ! [ ! [ $dietcurd !~
'.+yoho$' ] ] ]
1271 if ! ! ! $dietcurd !~
'.+yoho$'
1276 if ! ! ! $dietcurd =~
'.+yoho$'
1281 if ! [ ! ! [ ! [ $dietcurd !~
'.+yoho$' ] ] ]
1286 set diet
=abc curd
='^abc$'
1292 set diet
=abc curd
='^abcd$'
1299 ex0_test behave
:if-regex
1300 cksum_test behave
:if-regex
"${MBOX}" '439960016 81'
1304 t_behave_localopts
() {
1305 # Nestable conditions test
1306 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} > "${MBOX}"
1321 echo $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2
1326 echo $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2
1327 echo "$gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2"
1336 echo active trouble: $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t3
1338 echo active null: $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t3
1344 #gv1 lv1 lv2 lv3 gv2, t2
1352 #gv1 lv1 lv2 lv3 gv2, t2
1355 #active trouble: gv1 gv2,
1357 ex0_test behave:localopts
1358 cksum_test behave:localopts "${MBOX}" '1936527193 192'
1361 t_behave_macro_param_shift() {
1362 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} > "${MBOX}" 2>/dev
/null
1365 echo t2.0 has
$#/${#} parameters: "$1,${2},$3" (${*}) [$@
]
1370 echo t2.1 has
$#/${#} parameters: "$1,${2},$3" (${*}) [$@
]
1371 if [ $# > 1 ] ||
[ $ignerr == '' ]
1376 echo t2.2
:$? has
$#/${#} parameters: "$1,${2},$3" (${*}) [$@
]
1378 echo t2.3
:$? has
$#/${#} parameters: "$1,${2},$3" (${*}) [$@
]
1382 echo t2.4
:$? has
$#/${#} parameters: "$1,${2},$3" (${*}) [$@
]
1387 call t2
1 you get four args
1388 echo t1.1
: $?
';' ignerr
($ignerr) should not exist
1389 call t2
1 you get
'three args'
1390 echo t1.2
: $?
';' ignerr
($ignerr) should not exist
1391 call t2
1 you
'get two args'
1392 echo t1.3
: $?
';' ignerr
($ignerr) should not exist
1393 call t2
1 'you get one arg'
1394 echo t1.4
: $?
';' ignerr
($ignerr) should not exist
1395 ignerr call t2
'' 'you get one arg'
1396 echo t1.5
: $?
';' ignerr
($ignerr) should not exist
1402 #t2.0 has 5/5 parameters: 1,you,get (1 you get four args) [1 you get four args]
1403 #t2.1 has 4/4 parameters: you,get,four (you get four args) [you get four args]
1404 #t2.2:0 has 2/2 parameters: four,args, (four args) [four args]
1405 #t2.3:0 has 2/2 parameters: four,args, (four args) [four args]
1406 #t2.4:0 has 1/1 parameters: args,, (args) [args]
1407 #t1.1: 0; ignerr () should not exist
1409 #t2.0 has 4/4 parameters: 1,you,get (1 you get three args) [1 you get three args]
1410 #t2.1 has 3/3 parameters: you,get,three args (you get three args) [you get three args]
1411 #t2.2:0 has 1/1 parameters: three args,, (three args) [three args]
1412 #t2.3:0 has 1/1 parameters: three args,, (three args) [three args]
1413 #t2.4:0 has 0/0 parameters: ,, () []
1414 #t1.2: 0; ignerr () should not exist
1416 #t2.0 has 3/3 parameters: 1,you,get two args (1 you get two args) [1 you get two args]
1417 #t2.1 has 2/2 parameters: you,get two args, (you get two args) [you get two args]
1418 #t2.2:0 has 0/0 parameters: ,, () []
1419 #t2.3:0 has 0/0 parameters: ,, () []
1420 #t2.4:0 has 0/0 parameters: ,, () []
1421 #t1.3: 0; ignerr () should not exist
1423 #t2.0 has 2/2 parameters: 1,you get one arg, (1 you get one arg) [1 you get one arg]
1424 #t2.1 has 1/1 parameters: you get one arg,, (you get one arg) [you get one arg]
1425 #t2.2:0 has 1/1 parameters: you get one arg,, (you get one arg) [you get one arg]
1426 #t2.3:0 has 1/1 parameters: you get one arg,, (you get one arg) [you get one arg]
1427 #t2.4:0 has 0/0 parameters: ,, () []
1428 #t1.4: 0; ignerr () should not exist
1430 #t2.0 has 2/2 parameters: ,you get one arg, ( you get one arg) [ you get one arg]
1431 #t2.1 has 1/1 parameters: you get one arg,, (you get one arg) [you get one arg]
1432 #t1.5: 1; ignerr () should not exist
1433 ex0_test behave
:macro_param_shift
1434 cksum_test behave
:macro_param_shift
"${MBOX}" '1402489146 1682'
1437 t_behave_addrcodec
() {
1438 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} > "${MBOX}"
1439 vput addrcodec res e 1 <doog@def>
1440 echo $?/$^ERRNAME $res
1441 eval vput addrcodec res d $res
1442 echo $?/$^ERRNAME $res
1443 vput addrcodec res e 2 . <doog@def>
1444 echo $?/$^ERRNAME $res
1445 eval vput addrcodec res d $res
1446 echo $?/$^ERRNAME $res
1447 vput addrcodec res e 3 Sauer Dr. <doog@def>
1448 echo $?/$^ERRNAME $res
1449 eval vput addrcodec res d $res
1450 echo $?/$^ERRNAME $res
1451 vput addrcodec res e 3.50 Sauer (Ma) Dr. <doog@def>
1452 echo $?/$^ERRNAME $res
1453 eval vput addrcodec res d $res
1454 echo $?/$^ERRNAME $res
1455 vput addrcodec res e 3.51 Sauer (Ma) "Dr.
" <doog@def>
1456 echo $?/$^ERRNAME $res
1457 eval vput addrcodec res d $res
1458 echo $?/$^ERRNAME $res
1460 vput addrcodec res +e 4 Sauer (Ma) Dr. <doog@def>
1461 echo $?/$^ERRNAME $res
1462 eval vput addrcodec res d $res
1463 echo $?/$^ERRNAME $res
1464 vput addrcodec res +e 5 Sauer (Ma) Braten Dr. <doog@def>
1465 echo $?/$^ERRNAME $res
1466 eval vput addrcodec res d $res
1467 echo $?/$^ERRNAME $res
1468 vput addrcodec res +e 6 Sauer (Ma) Braten Dr. (Heu) <doog@def>
1469 echo $?/$^ERRNAME $res
1470 eval vput addrcodec res d $res
1471 echo $?/$^ERRNAME $res
1472 vput addrcodec res +e 7 Sauer (Ma) Braten Dr. (Heu) <doog@def> (bu)
1473 echo $?/$^ERRNAME $res
1474 eval vput addrcodec res d $res
1475 echo $?/$^ERRNAME $res
1476 vput addrcodec res +e 8 \
1477 Dr. Sauer (Ma) Braten Dr. (Heu) <doog@def> (bu) Boom. Boom
1478 echo $?/$^ERRNAME $res
1479 eval vput addrcodec res d $res
1480 echo $?/$^ERRNAME $res
1481 vput addrcodec res +e 9 Dr.Sauer(Ma)Braten Dr. (Heu) <doog@def>
1482 echo $?/$^ERRNAME $res
1483 eval vput addrcodec res d $res
1484 echo $?/$^ERRNAME $res
1485 vput addrcodec res +e 10 (Ma)Braten Dr. (Heu) <doog@def>
1486 echo $?/$^ERRNAME $res
1487 eval vput addrcodec res d $res
1488 echo $?/$^ERRNAME $res
1489 vput addrcodec res +e 11 (Ma)Braten Dr".
" (Heu) <doog@def>
1490 echo $?/$^ERRNAME $res
1491 eval vput addrcodec res d $res
1492 echo $?/$^ERRNAME $res
1493 vput addrcodec res +e 12 Dr. Sauer (Ma) Braten Dr. (u) <doog@def>
1494 echo $?/$^ERRNAME $res
1495 eval vput addrcodec res d $res
1496 echo $?/$^ERRNAME $res
1497 vput addrcodec res +e 13(Ma)Braten Dr. (Heu) <doog@def>
1498 echo $?/$^ERRNAME $res
1499 eval vput addrcodec res d $res
1500 echo $?/$^ERRNAME $res
1501 vput addrcodec res +e 14 Hey, Du <doog@def> Wie() findet Dr. das? ()
1502 echo $?/$^ERRNAME $res
1503 eval vput addrcodec res d $res
1504 echo $?/$^ERRNAME $res
1505 vput addrcodec res +e 15 \
1506 Hey, Du <doog@def> Wie() findet "" Dr. "" das? ()
1507 echo $?/$^ERRNAME $res
1508 eval vput addrcodec res d $res
1509 echo $?/$^ERRNAME $res
1510 vput addrcodec res +e 16 \
1511 "Hey
," "Du
" <doog@def> "Wie
()" findet "" Dr. "" das? ()
1512 echo $?/$^ERRNAME $res
1513 eval vput addrcodec res d $res
1514 echo $?/$^ERRNAME $res
1515 vput addrcodec res +e 17 \
1516 "Hey
" Du <doog@def> "Wie
() findet
" " Dr.
""" das? ()
1517 echo $?/$^ERRNAME $res
1518 eval vput addrcodec res d $res
1519 echo $?/$^ERRNAME $res
1520 vput addrcodec res +e 18 \
1521 <doog@def> "Hey
" Du "Wie
() findet
" " Dr.
""" das? ()
1522 echo $?/$^ERRNAME $res
1523 eval vput addrcodec res d $res
1524 echo $?/$^ERRNAME $res
1525 vput addrcodec res +e 19 Hey\,\" <doog@def> "Wie
()" findet \" Dr. \" das?
1526 echo $?/$^ERRNAME $res
1527 eval vput addrcodec res d $res
1528 echo $?/$^ERRNAME $res
1530 vput addrcodec res ++e 20 Hey\,\" <doog@def> "Wie
()" findet \" Dr. \" das?
1531 echo $?/$^ERRNAME $res
1532 vput addrcodec res ++e 21 Hey\,\"" <doog@def
> "Wie()" findet
\" Dr.
\" das?
1533 echo $?
/$^ERRNAME
$res
1534 eval vput addrcodec res d
$res
1535 echo $?
/$^ERRNAME
$res
1537 vput addrcodec res
+++e
22 Hey\
,\" <doog@def
> "Wie()" findet
\" Dr.
\" das?
1538 echo $?
/$^ERRNAME
$res
1539 eval vput addrcodec res d
$res
1540 echo $?
/$^ERRNAME
$res
1542 vput addrcodec res s \
1543 "23 Hey\\,\\\" \"Wie" () "\" findet \\\" Dr. \\\" das?" <doog@def
>
1544 echo $?
/$^ERRNAME
$res
1546 #0/NONE 1 <doog@def>
1547 #0/NONE 1 <doog@def>
1548 #0/NONE "2 ." <doog@def>
1549 #0/NONE 2 . <doog@def>
1550 #0/NONE "3 Sauer Dr." <doog@def>
1551 #0/NONE 3 Sauer Dr. <doog@def>
1552 #0/NONE 3.50 "Sauer \(Ma\) Dr." <doog@def>
1553 #0/NONE 3.50 Sauer (Ma) Dr. <doog@def>
1554 #0/NONE 3.51 "Sauer \(Ma\) \"Dr.\"" <doog@def>
1555 #0/NONE 3.51 Sauer (Ma) "Dr." <doog@def>
1556 #0/NONE 4 Sauer (Ma) "Dr." <doog@def>
1557 #0/NONE 4 Sauer (Ma) Dr. <doog@def>
1558 #0/NONE 5 Sauer (Ma) "Braten Dr." <doog@def>
1559 #0/NONE 5 Sauer (Ma) Braten Dr. <doog@def>
1560 #0/NONE 6 Sauer (Ma) "Braten Dr." (Heu) <doog@def>
1561 #0/NONE 6 Sauer (Ma) Braten Dr. (Heu) <doog@def>
1562 #0/NONE 7 Sauer (Ma) "Braten Dr." (Heu bu) <doog@def>
1563 #0/NONE 7 Sauer (Ma) Braten Dr. (Heu bu) <doog@def>
1564 #0/NONE "8 Dr. Sauer" (Ma) "Braten Dr." (Heu bu) "Boom. Boom" <doog@def>
1565 #0/NONE 8 Dr. Sauer (Ma) Braten Dr. (Heu bu) Boom. Boom <doog@def>
1566 #0/NONE "9 Dr.Sauer" (Ma) "Braten Dr." (Heu) <doog@def>
1567 #0/NONE 9 Dr.Sauer (Ma) Braten Dr. (Heu) <doog@def>
1568 #0/NONE 10 (Ma) "Braten Dr." (Heu) <doog@def>
1569 #0/NONE 10 (Ma) Braten Dr. (Heu) <doog@def>
1570 #0/NONE 11 (Ma) "Braten Dr\".\"" (Heu) <doog@def>
1571 #0/NONE 11 (Ma) Braten Dr"." (Heu) <doog@def>
1572 #0/NONE "12 Dr. Sauer" (Ma) "Braten Dr." (u) <doog@def>
1573 #0/NONE 12 Dr. Sauer (Ma) Braten Dr. (u) <doog@def>
1574 #0/NONE 13 (Ma) "Braten Dr." (Heu) <doog@def>
1575 #0/NONE 13 (Ma) Braten Dr. (Heu) <doog@def>
1576 #0/NONE "14 Hey, Du Wie" () "findet Dr. das?" () <doog@def>
1577 #0/NONE 14 Hey, Du Wie () findet Dr. das? () <doog@def>
1578 #0/NONE "15 Hey, Du Wie" () "findet \"\" Dr. \"\" das?" () <doog@def>
1579 #0/NONE 15 Hey, Du Wie () findet "" Dr. "" das? () <doog@def>
1580 #0/NONE "16 \"Hey,\" \"Du\" \"Wie" () "\" findet \"\" Dr. \"\" das?" () <doog@def>
1581 #0/NONE 16 "Hey," "Du" "Wie () " findet "" Dr. "" das? () <doog@def>
1582 #0/NONE "17 \"Hey\" Du \"Wie" () "findet \" \" Dr. \"\"\" das?" () <doog@def>
1583 #0/NONE 17 "Hey" Du "Wie () findet " " Dr. """ das? () <doog@def>
1584 #0/NONE "18 \"Hey\" Du \"Wie" () "findet \" \" Dr. \"\"\" das?" () <doog@def>
1585 #0/NONE 18 "Hey" Du "Wie () findet " " Dr. """ das? () <doog@def>
1586 #0/NONE "19 Hey\\,\\\" \"Wie" () "\" findet \\\" Dr. \\\" das?" <doog@def>
1587 #0/NONE 19 Hey\,\" "Wie () " findet \" Dr. \" das? <doog@def>
1588 #1/INVAL 20 Hey\\,\\" <doog@def> "Wie()" findet \\" Dr. \\" das?
1589 #0/NONE "21 Hey\\,\\ Wie() findet \\ Dr. \\ das?" <doog@def>
1590 #0/NONE 21 Hey\,\ Wie() findet \ Dr. \ das? <doog@def>
1591 #0/NONE "22 Hey\,\" Wie() findet \" Dr. \" das?" <doog@def>
1592 #0/NONE 22 Hey," Wie() findet " Dr. " das? <doog@def>
1594 ex0_test behave
:addrcodec
1595 cksum_test behave
:addrcodec
"${MBOX}" '3907388894 2416'
1599 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} > "${MBOX}" 2>/dev/null
1600 vput vexpr res = 9223372036854775807
1601 echo $?/$^ERRNAME $res
1602 vput vexpr res = 9223372036854775808
1603 echo $?/$^ERRNAME $res
1604 vput vexpr res =@ 9223372036854775808
1605 echo $?/$^ERRNAME $res
1606 vput vexpr res = -9223372036854775808
1607 echo $?/$^ERRNAME $res
1608 vput vexpr res = -9223372036854775809
1609 echo $?/$^ERRNAME $res
1610 vput vexpr res =@ -9223372036854775809
1611 echo $?/$^ERRNAME $res
1614 echo $?/$^ERRNAME $res
1616 echo $?/$^ERRNAME $res
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
1627 vput vexpr res + 9223372036854775807 0
1628 echo $?/$^ERRNAME $res
1629 vput vexpr res + 9223372036854775807 1
1630 echo $?/$^ERRNAME $res
1631 vput vexpr res +@ 9223372036854775807 1
1632 echo $?/$^ERRNAME $res
1633 vput vexpr res + 0 9223372036854775807
1634 echo $?/$^ERRNAME $res
1635 vput vexpr res + 1 9223372036854775807
1636 echo $?/$^ERRNAME $res
1637 vput vexpr res +@ 1 9223372036854775807
1638 echo $?/$^ERRNAME $res
1640 vput vexpr res + -9223372036854775808 0
1641 echo $?/$^ERRNAME $res
1642 vput vexpr res + -9223372036854775808 -1
1643 echo $?/$^ERRNAME $res
1644 vput vexpr res +@ -9223372036854775808 -1
1645 echo $?/$^ERRNAME $res
1646 vput vexpr res + 0 -9223372036854775808
1647 echo $?/$^ERRNAME $res
1648 vput vexpr res + -1 -9223372036854775808
1649 echo $?/$^ERRNAME $res
1650 vput vexpr res +@ -1 -9223372036854775808
1651 echo $?/$^ERRNAME $res
1653 vput vexpr res - 0 0
1654 echo $?/$^ERRNAME $res
1655 vput vexpr res - 0 1
1656 echo $?/$^ERRNAME $res
1657 vput vexpr res - 1 1
1658 echo $?/$^ERRNAME $res
1660 vput vexpr res - 9223372036854775807 0
1661 echo $?/$^ERRNAME $res
1662 vput vexpr res - 9223372036854775807 -1
1663 echo $?/$^ERRNAME $res
1664 vput vexpr res -@ 9223372036854775807 -1
1665 echo $?/$^ERRNAME $res
1666 vput vexpr res - 0 9223372036854775807
1667 echo $?/$^ERRNAME $res
1668 vput vexpr res - -1 9223372036854775807
1669 echo $?/$^ERRNAME $res
1670 vput vexpr res - -2 9223372036854775807
1671 echo $?/$^ERRNAME $res
1672 vput vexpr res -@ -2 9223372036854775807
1673 echo $?/$^ERRNAME $res
1675 vput vexpr res - -9223372036854775808 +0
1676 echo $?/$^ERRNAME $res
1677 vput vexpr res - -9223372036854775808 +1
1678 echo $?/$^ERRNAME $res
1679 vput vexpr res -@ -9223372036854775808 +1
1680 echo $?/$^ERRNAME $res
1681 vput vexpr res - 0 -9223372036854775808
1682 echo $?/$^ERRNAME $res
1683 vput vexpr res - +1 -9223372036854775808
1684 echo $?/$^ERRNAME $res
1685 vput vexpr res -@ +1 -9223372036854775808
1686 echo $?/$^ERRNAME $res
1688 vput vexpr res + -13 -2
1689 echo $?/$^ERRNAME $res
1690 vput vexpr res - 0 0
1691 echo $?/$^ERRNAME $res
1692 vput vexpr res - 0 1
1693 echo $?/$^ERRNAME $res
1694 vput vexpr res - 1 1
1695 echo $?/$^ERRNAME $res
1696 vput vexpr res - -13 -2
1697 echo $?/$^ERRNAME $res
1699 vput vexpr res * 0 0
1700 echo $?/$^ERRNAME $res
1701 vput vexpr res * 0 1
1702 echo $?/$^ERRNAME $res
1703 vput vexpr res * 1 1
1704 echo $?/$^ERRNAME $res
1705 vput vexpr res * -13 -2
1706 echo $?/$^ERRNAME $res
1708 vput vexpr res / 0 0
1709 echo $?/$^ERRNAME $res
1710 vput vexpr res / 0 1
1711 echo $?/$^ERRNAME $res
1712 vput vexpr res / 1 1
1713 echo $?/$^ERRNAME $res
1714 vput vexpr res / -13 -2
1715 echo $?/$^ERRNAME $res
1717 vput vexpr res % 0 0
1718 echo $?/$^ERRNAME $res
1719 vput vexpr res % 0 1
1720 echo $?/$^ERRNAME $res
1721 vput vexpr res % 1 1
1722 echo $?/$^ERRNAME $res
1723 vput vexpr res % -13 -2
1724 echo $?/$^ERRNAME $res
1726 #0/NONE 9223372036854775807
1728 #0/OVERFLOW 9223372036854775807
1729 #0/NONE -9223372036854775808
1731 #0/OVERFLOW -9223372036854775808
1741 #0/NONE 9223372036854775807
1743 #0/OVERFLOW 9223372036854775807
1744 #0/NONE 9223372036854775807
1746 #0/OVERFLOW 9223372036854775807
1748 #0/NONE -9223372036854775808
1750 #0/OVERFLOW -9223372036854775808
1751 #0/NONE -9223372036854775808
1753 #0/OVERFLOW -9223372036854775808
1759 #0/NONE 9223372036854775807
1761 #0/OVERFLOW 9223372036854775807
1762 #0/NONE -9223372036854775807
1763 #0/NONE -9223372036854775808
1765 #0/OVERFLOW -9223372036854775808
1767 #0/NONE -9223372036854775808
1769 #0/OVERFLOW -9223372036854775808
1770 #0/NONE -9223372036854775808
1772 #0/OVERFLOW -9223372036854775808
1794 ex0_test behave:vexpr-numeric
1795 cksum_test behave:vexpr-numeric "${MBOX}" '1723609217 1048'
1797 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} > "${MBOX}" #2>/dev/null
1798 vput vexpr res
find 'bananarama' 'nana'
1799 echo $?
/$^ERRNAME
:$res:
1800 vput vexpr res
find 'bananarama' 'bana'
1801 echo $?
/$^ERRNAME
:$res:
1802 vput vexpr res
find 'bananarama' 'Bana'
1803 echo $?
/$^ERRNAME
:$res:
1804 vput vexpr res
find 'bananarama' 'rama'
1805 echo $?
/$^ERRNAME
:$res:
1807 vput vexpr res ifind
'bananarama' 'nana'
1808 echo $?
/$^ERRNAME
:$res:
1809 vput vexpr res ifind
'bananarama' 'bana'
1810 echo $?
/$^ERRNAME
:$res:
1811 vput vexpr res ifind
'bananarama' 'Bana'
1812 echo $?
/$^ERRNAME
:$res:
1813 vput vexpr res ifind
'bananarama' 'rama'
1814 echo $?
/$^ERRNAME
:$res:
1816 vput vexpr res substring
'bananarama' 1
1817 echo $?
/$^ERRNAME
:$res:
1818 vput vexpr res substring
'bananarama' 3
1819 echo $?
/$^ERRNAME
:$res:
1820 vput vexpr res substring
'bananarama' 5
1821 echo $?
/$^ERRNAME
:$res:
1822 vput vexpr res substring
'bananarama' 7
1823 echo $?
/$^ERRNAME
:$res:
1824 vput vexpr res substring
'bananarama' 9
1825 echo $?
/$^ERRNAME
:$res:
1826 vput vexpr res substring
'bananarama' 10
1827 echo $?
/$^ERRNAME
:$res:
1828 vput vexpr res substring
'bananarama' 1 3
1829 echo $?
/$^ERRNAME
:$res:
1830 vput vexpr res substring
'bananarama' 3 3
1831 echo $?
/$^ERRNAME
:$res:
1832 vput vexpr res substring
'bananarama' 5 3
1833 echo $?
/$^ERRNAME
:$res:
1834 vput vexpr res substring
'bananarama' 7 3
1835 echo $?
/$^ERRNAME
:$res:
1836 vput vexpr res substring
'bananarama' 9 3
1837 echo $?
/$^ERRNAME
:$res:
1838 vput vexpr res substring
'bananarama' 10 3
1839 echo $?
/$^ERRNAME
:$res:
1865 ex0_test behave
:vexpr-string
1866 cksum_test behave
:vexpr-string
"${MBOX}" '265398700 267'
1868 if have_feat regex
; then
1869 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} > "${MBOX}" #2>/dev/null
1870 vput vexpr res regex 'bananarama' 'nana'
1871 echo $?/$^ERRNAME :$res:
1872 vput vexpr res regex 'bananarama' 'bana'
1873 echo $?/$^ERRNAME :$res:
1874 vput vexpr res regex 'bananarama' 'Bana'
1875 echo $?/$^ERRNAME :$res:
1876 vput vexpr res regex 'bananarama' 'rama'
1877 echo $?/$^ERRNAME :$res:
1879 vput vexpr res iregex 'bananarama' 'nana'
1880 echo $?/$^ERRNAME :$res:
1881 vput vexpr res iregex 'bananarama' 'bana'
1882 echo $?/$^ERRNAME :$res:
1883 vput vexpr res iregex 'bananarama' 'Bana'
1884 echo $?/$^ERRNAME :$res:
1885 vput vexpr res iregex 'bananarama' 'rama'
1886 echo $?/$^ERRNAME :$res:
1888 vput vexpr res regex 'bananarama' '(.*)nana(.*)' '\${1}a\${0}u{\$2}'
1889 echo $?/$^ERRNAME :$res:
1890 vput vexpr res regex 'bananarama' '(.*)bana(.*)' '\${1}a\${0}u\$2'
1891 echo $?/$^ERRNAME :$res:
1892 vput vexpr res regex 'bananarama' 'Bana(.+)' '\$1\$0'
1893 echo $?/$^ERRNAME :$res:
1894 vput vexpr res regex 'bananarama' '(.+)rama' '\$1\$0'
1895 echo $?/$^ERRNAME :$res:
1897 vput vexpr res iregex 'bananarama' '(.*)nana(.*)' '\${1}a\${0}u{\$2}'
1898 echo $?/$^ERRNAME :$res:
1899 vput vexpr res iregex 'bananarama' '(.*)bana(.*)' '\${1}a\${0}u\$2'
1900 echo $?/$^ERRNAME :$res:
1901 vput vexpr res iregex 'bananarama' 'Bana(.+)' '\$1\$0'
1902 echo $?/$^ERRNAME :$res:
1903 vput vexpr res iregex 'bananarama' '(.+)rama' '\$1\$0'
1904 echo $?/$^ERRNAME :$res:
1917 #0/NONE :baabananaramau{rama}:
1918 #0/NONE :abananaramaunarama:
1920 #0/NONE :bananabananarama:
1922 #0/NONE :baabananaramau{rama}:
1923 #0/NONE :abananaramaunarama:
1924 #0/NONE :naramabananarama:
1925 #0/NONE :bananabananarama:
1927 ex0_test behave:vexpr-regex
1928 cksum_test behave:vexpr-regex "${MBOX}" '3270360157 311'
1932 t_behave_call_ret() {
1933 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} -Snomemdebug > "${MBOX}" 2>&1
1938 vput vexpr j
'&' $i 7
1944 vput vexpr j
'&' $i 7
1950 echo ! The end
for $1
1954 # Transport $?/$! up the call chain
1964 echo ! The end
for $1
1965 return $i $^ERR-BUSY
1969 # Up and down it goes
1976 vput vexpr k
- $1 $2
1980 echo "# <$i/$j> .. "
1987 vput vexpr j
+ $^ERR-BUSY
$2
1988 echo ! The end
for $1=$i/$j
1994 call w1
0; echo ?
=$?
!=$
!; echo -----;
1995 call w2
0; echo ?
=$?
!=$
!; echo -----;
1996 call w3
0 1; echo ?
=$?
!=$
!; echo -----;
1998 ex0_test behave
:call_ret
1999 cksum_test behave
:call_ret
"${MBOX}" '2240086482 5844'
2003 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} -Snomemdebug > "${MBOX}" 2>&1
2008 vput vexpr j '&' $i 7
2014 echo ! The end for $1/$2
2016 return $i $^ERR-BUSY
2034 ex0_test behave:xcall
2035 cksum_test behave:xcall-1 "${MBOX}" '1579767783 19097'
2039 ${cat} <<- '__EOT' > "${BODY}"
2044 vput vexpr j '&' $i 7
2050 echo ! The end for $1
2053 echo would be err with errexit
2062 echo zwei, ?=$? !=$!
2063 localopts yes; set errexit
2065 echo drei, ?=$? !=$!
2067 echo vier, ?=$? !=$!, this is an error
2070 echo outer 1, ?=$? !=$!
2072 echo outer 2, ?=$? !=$!, could be error if xxxign non-empty
2074 echo outer 3, ?=$? !=$!
2075 echo this is definitely an error
2078 < "${BODY}" "${SNAIL}" ${ARGS} -X'commandalias xxxign ignerr' -Snomemdebug \
2080 ex0_test behave
:xcall-2
2081 cksum_test behave
:xcall-2
"${MBOX}" '4079235300 4097'
2083 < "${BODY}" "${SNAIL}" ${ARGS} -X'commandalias xxxign " "' -Snomemdebug \
2085 exn0_test behave:xcall-3
2086 cksum_test behave:xcall-3 "${MBOX}" '1132745876 2724'
2089 t_behave_e_H_L_opts() {
2090 TRAP_EXIT_ADDONS=".
/.tsendmail.sh .
/.t.mbox
"
2093 "${SNAIL}" ${ARGS} -ef ./.t.mbox
2094 echo ${?} > "${MBOX}"
2096 ${cat} <<-_EOT > ./.tsendmail.sh
2098 (echo 'From Alchemilla Wed Apr 07 17:03:33 2017' && ${cat} && echo
2101 chmod 0755 ./.tsendmail.sh
2102 printf 'm me@exam.ple\nLine 1.\nHello.\n~.\n' |
2103 "${SNAIL}" ${ARGS} -Smta=./.tsendmail.sh
2104 printf 'm you@exam.ple\nLine 1.\nBye.\n~.\n' |
2105 "${SNAIL}" ${ARGS} -Smta=./.tsendmail.sh
2107 "${SNAIL}" ${ARGS} -ef ./.t.mbox
2108 echo ${?} >> "${MBOX}"
2109 "${SNAIL}" ${ARGS} -efL @t@me ./.t.mbox
2110 echo ${?} >> "${MBOX}"
2111 "${SNAIL}" ${ARGS} -efL @t@you ./.t.mbox
2112 echo ${?} >> "${MBOX}"
2113 "${SNAIL}" ${ARGS} -efL '@>@Line 1' ./.t.mbox
2114 echo ${?} >> "${MBOX}"
2115 "${SNAIL}" ${ARGS} -efL '@>@Hello.' ./.t.mbox
2116 echo ${?} >> "${MBOX}"
2117 "${SNAIL}" ${ARGS} -efL '@>@Bye.' ./.t.mbox
2118 echo ${?} >> "${MBOX}"
2119 "${SNAIL}" ${ARGS} -efL '@>@Good bye.' ./.t.mbox
2120 echo ${?} >> "${MBOX}"
2122 "${SNAIL}" ${ARGS} -fH ./.t.mbox >> "${MBOX}"
2123 echo ${?} >> "${MBOX}"
2124 "${SNAIL}" ${ARGS} -fL @t@me ./.t.mbox >> "${MBOX}"
2125 echo ${?} >> "${MBOX}"
2126 "${SNAIL}" ${ARGS} -fL @t@you ./.t.mbox >> "${MBOX}"
2127 echo ${?} >> "${MBOX}"
2128 "${SNAIL}" ${ARGS} -fL '@>@Line 1' ./.t.mbox >> "${MBOX}"
2129 echo ${?} >> "${MBOX}"
2130 "${SNAIL}" ${ARGS} -fL '@>@Hello.' ./.t.mbox >> "${MBOX}"
2131 echo ${?} >> "${MBOX}"
2132 "${SNAIL}" ${ARGS} -fL '@>@Bye.' ./.t.mbox >> "${MBOX}"
2133 echo ${?} >> "${MBOX}"
2134 "${SNAIL}" ${ARGS} -fL '@>@Good bye.' ./.t.mbox >> "${MBOX}" 2>/dev/null
2135 echo ${?} >> "${MBOX}"
2137 ${rm} -f ${TRAP_EXIT_ADDONS}
2148 #>N 1 Alchemilla 1996-10-02 01:50 7/112
2149 # N 2 Alchemilla 1996-10-02 01:50 7/111
2151 #>N 1 Alchemilla 1996-10-02 01:50 7/112
2153 # N 2 Alchemilla 1996-10-02 01:50 7/111
2155 #>N 1 Alchemilla 1996-10-02 01:50 7/112
2156 # N 2 Alchemilla 1996-10-02 01:50 7/111
2158 #>N 1 Alchemilla 1996-10-02 01:50 7/112
2160 # N 2 Alchemilla 1996-10-02 01:50 7/111
2163 cksum_test behave:e_H_L_opts "${MBOX}" '1708955574 678'
2166 t_behave_compose_hooks() {
2167 TRAP_EXIT_ADDONS=".
/.tsendmail.sh .
/.tnotes
"
2169 ${cat} <<-_EOT > ./.tsendmail.sh
2172 (echo 'From PrimulaVeris Wed Apr 10 22:59:00 2017' && ${cat}) > "${MBOX}"
2174 chmod 0755 ./.tsendmail.sh
2176 printf 'm hook-test@exam.ple\nbody\n~.\nvar t_oce t_ocs t_ocs_shell t_ocl' |
2177 "${SNAIL}" ${ARGS} \
2178 -Smta=./.tsendmail.sh \
2183 echo "~^header list
"; read hl; vput vexpr es substr "$hl" 0 1
2185 echoerr "Failed to header list
, aborting send
"; echo "~x
"
2187 echo "~^header insert cc splicy diet
<splice@exam.ple
> spliced
";\
2188 read es; vput vexpr es substr "$es" 0 1
2190 echoerr "Failed to be diet
, aborting send
"; echo "~x
"
2192 echo "~^header insert bcc juicy juice
<juice@exam.ple
> spliced
";\
2193 read es; vput vexpr es substr "$es" 0 1
2195 echoerr "Failed to be juicy
, aborting send
"; echo "~x
"
2200 set t_oce autobcc=oce@exam.ple
2203 set t_ocl autocc=ocl@exam.ple
2205 wysh set on-compose-splice=t_ocs \
2206 on-compose-splice-shell="read ver
;printf \"t_ocs-shell
\\n\
2207 ~t shell@exam.ple
\\n~
:set t_ocs_shell
\\n
\"" \
2208 on-compose-enter=t_oce on-compose-leave=t_ocl
2210 ex0_test behave:compose_hooks
2211 ${cat} ./.tnotes >> "${MBOX}"
2213 ${rm} -f ${TRAP_EXIT_ADDONS}
2216 #From PrimulaVeris Wed Apr 10 22:59:00 2017
2217 #Date: Wed, 02 Oct 1996 01:50:07 +0000
2218 #To: hook-test@exam.ple, shell@exam.ple
2219 #Cc: ocl@exam.ple, splicy diet spliced <splice@exam.ple>
2220 #Bcc: juicy juice spliced <juice@exam.ple>, oce@exam.ple
2225 ##variable not set: t_oce
2226 ##variable not set: t_ocs
2227 ##variable not set: t_ocs_shell
2228 ##variable not set: t_ocl
2229 cksum_test behave:compose_hooks "${MBOX}" '3240856112 319'
2232 t_behave_smime() { # FIXME add test/ dir, unroll tests therein
2233 TRAP_EXIT_ADDONS=".
/.t.conf .
/.tkey.pem .
/.tcert.pem .
/.tpair.pem
"
2234 TRAP_EXIT_ADDONS="${TRAP_EXIT_ADDONS} .
/.VERIFY .
/.DECRYPT .
/.ENCRYPT
"
2235 TRAP_EXIT_ADDONS="${TRAP_EXIT_ADDONS} .
/.tsendmail.sh
"
2237 printf 'behave:s/mime: .. generating test key and certificate ..\n'
2238 ${cat} <<-_EOT > ./.t.conf
2241 default_keyfile = keyfile.pem
2242 distinguished_name = req_distinguished_name
2243 attributes = req_attributes
2247 [ req_distinguished_name ]
2254 emailAddress = test@localhost
2259 openssl req -x509 -nodes -days 3650 -config ./.t.conf \
2260 -newkey rsa:1024 -keyout ./.tkey.pem -out ./.tcert.pem >/dev/null 2>&1
2261 ${cat} ./.tkey.pem ./.tcert.pem > ./.tpair.pem
2263 printf "behave
:s
/mime
:sign
/verify
: "
2264 echo bla | "${SNAIL}" ${ARGS} \
2265 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
2266 -Ssmime-sign -Sfrom=test@localhost \
2267 -s 'S/MIME test' ./.VERIFY
2268 printf 'verify\nx\n' |
2269 "${SNAIL}" ${ARGS} \
2270 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
2271 -Ssmime-sign -Sfrom=test@localhost \
2273 -f ./.VERIFY >/dev/null 2>&1
2274 if [ $? -eq 0 ]; then
2277 printf 'error: verification failed\n'
2279 ${rm} -f ${TRAP_EXIT_ADDONS}
2283 printf ' .. disproof via openssl smime(1): '
2284 if openssl smime -verify -CAfile ./.tcert.pem \
2285 -in ./.VERIFY >/dev/null 2>&1; then
2290 ${rm} -f ${TRAP_EXIT_ADDONS}
2295 # (signing +) encryption / decryption
2296 ${cat} <<-_EOT > ./.tsendmail.sh
2299 (echo 'From S-Postman Thu May 10 20:40:54 2012' && ${cat}) > ./.ENCRYPT
2301 chmod 0755 ./.tsendmail.sh
2303 printf "behave
:s
/mime
:encrypt
+sign
/decrypt
+verify
: "
2305 "${SNAIL}" ${ARGS} \
2306 -Ssmime-force-encryption \
2307 -Ssmime-encrypt-recei@ver.com=./.tpair.pem \
2308 -Smta=./.tsendmail.sh \
2309 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
2310 -Ssmime-sign -Sfrom=test@localhost \
2311 -s 'S/MIME test' recei@ver.com
2313 printf 'decrypt ./.DECRYPT\nfi ./.DECRYPT\nverify\nx\n' |
2314 "${SNAIL}" ${ARGS} \
2315 -Ssmime-force-encryption \
2316 -Ssmime-encrypt-recei@ver.com=./.tpair.pem \
2317 -Smta=./.tsendmail.sh \
2318 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
2319 -Ssmime-sign -Sfrom=test@localhost \
2321 -f ./.ENCRYPT >/dev/null 2>&1
2322 if [ $? -eq 0 ]; then
2326 printf 'error: decryption+verification failed\n'
2328 printf ' ..disproof via openssl smime(1): '
2329 if (openssl smime -decrypt -inkey ./.tkey.pem -in ./.ENCRYPT |
2330 openssl smime -verify -CAfile ./.tcert.pem) >/dev/null 2>&1; then
2336 ${sed} -e '/^Date:/d' -e '/^X-Decoding-Date/d' \
2338 '/^Content-Disposition: attachment; filename="smime.p7s
"/,/^-- /d' \
2339 < ./.DECRYPT > ./.ENCRYPT
2340 cksum_test ".. checksum of decrypted content
" ".
/.ENCRYPT
" '3090916509 510'
2342 printf "behave
:s
/mime
:encrypt
/decrypt
: "
2344 echo bla | "${SNAIL}" ${ARGS} \
2345 -Ssmime-force-encryption \
2346 -Ssmime-encrypt-recei@ver.com=./.tpair.pem \
2347 -Smta=./.tsendmail.sh \
2348 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
2349 -Sfrom=test@localhost \
2350 -s 'S/MIME test' recei@ver.com
2351 printf 'decrypt ./.DECRYPT\nx\n' | "${SNAIL}" ${ARGS} \
2352 -Ssmime-force-encryption \
2353 -Ssmime-encrypt-recei@ver.com=./.tpair.pem \
2354 -Smta=./.tsendmail.sh \
2355 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
2356 -Sfrom=test@localhost \
2358 -f ./.ENCRYPT >/dev/null 2>&1
2359 if [ $? -eq 0 ]; then
2363 printf 'error: decryption failed\n'
2365 printf '.. disproof via openssl smime(1): '
2366 if openssl smime -decrypt -inkey ./.tkey.pem \
2367 -in ./.ENCRYPT >/dev/null 2>&1; then
2373 ${sed} -e '/^Date:/d' -e '/^X-Decoding-Date/d' \
2374 < ./.DECRYPT > ./.ENCRYPT
2375 cksum_test ".. checksum of decrypted content
" ./.ENCRYPT '999887248 295'
2377 ${rm} -f ${TRAP_EXIT_ADDONS}
2382 # Some basic tests regarding correct sending of mails, via STDIN / -t / -q,
2383 # including basic MIME Content-Transfer-Encoding correctness (quoted-printable)
2384 # Note we unfortunately need to place some statements without proper
2385 # indentation because of continuation problems
2387 # MIME encoding (QP) stress message body
2389 'Ich bin eine DÖS-Datäi mit sehr langen Zeilen und auch '\
2390 'sonst bin ich ganz schön am Schleudern, da kannste denke '\
2391 "wasde willst
, gelle
, gelle
, gelle
, gelle
, gelle.
\r\n"\
2392 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
\r\n"\
2393 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
1\r\n"\
2394 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
12\r\n"\
2395 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
123\r\n"\
2396 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
1234\r\n"\
2397 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
12345\r\n"\
2398 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
123456\r\n"\
2399 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
1234567\r\n"\
2400 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
12345678\r\n"\
2401 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
123456789\r\n"\
2402 "Unn ausserdem habe ich trailing SP
/HT
/SP
/HT whitespace
\r\n"\
2403 "Unn ausserdem habe ich trailing HT
/SP
/HT
/SP whitespace
\r\n"\
2404 "auf den zeilen vorher.
\r\n"\
2405 "From am Zeilenbeginn und From der Mitte gibt es auch.
\r\n"\
2407 "Die letzte Zeile war nur ein Punkt.
\r\n"\
2409 "Das waren deren zwei.
\r\n"\
2411 "Die letzte Zeile war ein Leerschritt.
\n"\
2412 "=VIER
= EQUAL SIGNS
=ON A LINE
=\r\n"\
2415 "Die letzte Zeile war nur ein Punkt
, mit Unix Zeilenende.
\n"\
2417 "Das waren deren zwei. ditto.
\n"\
2419 "Unn ausseerdem habe ich trailing SP
/HT
/SP
/HT whitespace
\n"\
2420 "Unn ausseerdem habe ich trailing HT
/SP
/HT
/SP whitespace
\n"\
2421 "auf den zeilen vorher.
\n"\
2423 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende.
\n"\
2424 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.1"\
2426 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.12"\
2428 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.12"\
2430 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.12"\
2432 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.12"\
2434 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.12"\
2436 "QP am Zeilenende über soft-nl hinweg
\n"\
2437 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende.
"\
2439 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende.
"\
2441 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende.
"\
2443 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende.
"\
2445 "=VIER
= EQUAL SIGNS
=ON A LINE
=\n"\
2447 "Die letzte Zeile war ein Leerschritt.
\n"\
2451 # MIME encoding (QP) stress message subject
2452 SUB="Äbrä Kä?dä
=brö Fü?di
=bus? \
2453 adadaddsssssssddddddddddddddddddddd\
2454 ddddddddddddddddddddddddddddddddddd\
2455 ddddddddddddddddddddddddddddddddddd\
2456 dddddddddddddddddddd Hallelulja? Od\
2457 er?? eeeeeeeeeeeeeeeeeeeeeeeeeeeeee\
2458 eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\
2459 eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee f\
2460 fffffffffffffffffffffffffffffffffff\
2461 fffffffffffffffffffff ggggggggggggg\
2462 ggggggggggggggggggggggggggggggggggg\
2463 ggggggggggggggggggggggggggggggggggg\
2464 ggggggggggggggggggggggggggggggggggg\
2467 # Three tests for MIME encodign and (a bit) content classification.
2468 # At the same time testing -q FILE, < FILE and -t FILE
2471 < "${BODY}" "${SNAIL}" ${ARGS} ${ADDARG_UNI} \
2472 -a "${BODY}" -s "${SUB}" "${MBOX}"
2473 ex0_test content
:001
2474 cksum_test content
:001 "${MBOX}" '2356108758 6413'
2477 < /dev
/null
"${SNAIL}" ${ARGS} ${ADDARG_UNI} \
2478 -a "${BODY}" -s "${SUB}" -q "${BODY}" "${MBOX}"
2479 ex0_test content:002
2480 cksum_test content:002 "${MBOX}" '2356108758 6413'
2483 ( echo "To
: ${MBOX}" && echo "Subject
: ${SUB}" && echo &&
2485 ) | "${SNAIL}" ${ARGS} ${ADDARG_UNI} -Snodot -a "${BODY}" -t
2486 ex0_test content:003
2487 cksum_test content:003 "${MBOX}" '2356108758 6413'
2489 # Test for [260e19d] (Juergen Daubert)
2491 echo body | "${SNAIL}" ${ARGS} "${MBOX}"
2492 ex0_test content:004
2493 cksum_test content:004 "${MBOX}" '4004005686 49'
2495 # Sending of multiple mails in a single invocation
2497 ( printf "m
${MBOX}\n~s subject1
\nE
-Mail Körper
1\n~.
\n" &&
2498 printf "m
${MBOX}\n~s subject2
\nEmail body
2\n~.
\n" &&
2500 ) | "${SNAIL}" ${ARGS} ${ADDARG_UNI}
2501 ex0_test content
:005
2502 cksum_test content
:005 "${MBOX}" '2157252578 260'
2506 # "Test for" [d6f316a] (Gavin Troy)
2508 printf "m ${MBOX}\n~s subject1\nEmail body\n~.\nfi ${MBOX}\np\nx\n" |
2509 "${SNAIL}" ${ARGS} ${ADDARG_UNI} -Spipe-text/plain="${cat}" > "${BODY}"
2510 ex0_test content
:006
2511 ${sed} -e 1d < "${BODY}" > "${MBOX}"
2512 cksum_test content:006 "${MBOX}" '2273863401 83'
2514 # "Test
for" [c299c45] (Peter Hofmann) TODO shouldn't end up QP-encoded?
2517 for(i = 0; i < 10000; ++i)
2519 #printf "\xF0\x90\x87\x90"
2520 }' | "${SNAIL}" ${ARGS} ${ADDARG_UNI} -s TestSubject "${MBOX}"
2521 ex0_test content:007
2522 cksum_test content:007 "${MBOX}" '1754234717 61767'
2524 ## Test some more corner cases for header bodies (as good as we can today) ##
2528 echo | "${SNAIL}" ${ARGS} ${ADDARG_UNI} \
2529 -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̲' \
2531 ex0_test content
:008
2532 cksum_test content
:008 "${MBOX}" '1563381297 326'
2534 # Single word (overlong line split -- bad standard! Requires injection of
2535 # artificial data!! Bad can be prevented by using RFC 2047 encoding)
2537 i
=`${awk} 'BEGIN{for(i=0; i<92; ++i) printf "0123456789_"}'`
2538 echo |
"${SNAIL}" ${ARGS} -s "${i}" "${MBOX}"
2539 ex0_test content
:009
2540 cksum_test content
:009 "${MBOX}" '1996714851 1669'
2542 # Combination of encoded words, space and tabs of varying sort
2544 echo |
"${SNAIL}" ${ARGS} ${ADDARG_UNI} \
2545 -s "1Abrä Kaspas1
2Abra Katä b_kaspas2 \
2546 3Abrä Kaspas3
4Abrä Kaspas4
5Abrä Kaspas5 \
2547 6Abra Kaspas6
7Abrä Kaspas7
8Abra Kaspas8 \
2548 9Abra Kaspastäb4-3
10Abra Kaspas1 _
11Abra Katäb1 \
2549 12Abra Kadabrä
1 After Tab after Täb this is NUTS
" \
2551 ex0_test content:010
2552 cksum_test content:010 "${MBOX}" '2956039469 542'
2554 # Overlong multibyte sequence that must be forcefully split
2555 # todo This works even before v15.0, but only by accident
2557 echo | "${SNAIL}" ${ARGS} ${ADDARG_UNI} \
2558 -s "✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄\
2559 ✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄\
2560 ✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄" \
2562 ex0_test content
:011
2563 cksum_test content
:011 "${MBOX}" '454973928 610'
2567 echo |
"${SNAIL}" ${ARGS} \
2568 -s "1-1 B2 B3 B4 B5 B6 B\
2569 1-2 B2 B3 B4 B5 B6 B\
2570 1-3 B2 B3 B4 B5 B6 B\
2571 1-4 B2 B3 B4 B5 B6 B\
2572 1-5 B2 B3 B4 B5 B6 B\
2573 1-6 B2 B3 B4 B5 B6 " \
2575 ex0_test content
:012
2576 cksum_test content
:012 "${MBOX}" '1014122962 248'
2578 # Leading and trailing WS
2580 echo |
"${SNAIL}" ${ARGS} \
2581 -s " 2-1 B2 B3 B4 B5 B6 B\
2582 1-2 B2 B3 B4 B5 B6 B\
2583 1-3 B2 B3 B4 B5 B6 B\
2584 1-4 B2 B3 B4 B5 B6 " \
2586 ex0_test content
:013
2587 cksum_test content
:013 "${MBOX}" '3212167908 187'
2589 # Quick'n dirty RFC 2231 test; i had more when implementing it, but until we
2590 # have a (better) test framework materialize a quick shot
2592 TRAP_EXIT_ADDONS
=.
/.ttt
2594 mkdir .
/.ttt ||
exit 1
2598 : > 'diet\ is \curd.txt'
2599 : > 'diet "is" curd.txt'
2601 : > 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
2602 : > höde__tröge__müde__dätte__hätte__vuelle__guelle__aese__aesse__sauerliche__kräuter__österliche__grüße__mäh.txt
2603 : > hööööööööööööööööö_nöööööööööööööööööööööö_düüüüüüüüüüüüüüüüüüü_bäääääääääääääääääääääääh.txt
2604 : > ✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆.txt
2606 echo bla |
"${SNAIL}" ${ARGS} ${ADDARG_UNI} \
2607 -a ".
/.ttt
/ma
'ger.txt" -a "./.ttt/mä'ger.txt
" \
2608 -a './.ttt/diet\ is \curd.txt' -a './.ttt/diet "is
" curd.txt' \
2609 -a ./.ttt/höde-tröge.txt \
2610 -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 \
2611 -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 \
2612 -a ./.ttt/hööööööööööööööööö_nöööööööööööööööööööööö_düüüüüüüüüüüüüüüüüüü_bäääääääääääääääääääääääh.txt \
2613 -a ./.ttt/✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆.txt \
2615 ex0_test content:014-1
2617 cksum_test content:014-1 "${MBOX}" '589846634 2491'
2619 printf "Resend
${BODY}\nx\n" | "${SNAIL}" ${ARGS} -f "${MBOX}"
2620 ex0_test content:014-2
2621 cksum_test content:014-2 "${MBOX}" '589846634 2491'
2625 if have_feat devel; then
2626 ARGS="${ARGS} -Smemdebug"
2633 if [ -z "${CHECK_ONLY}" ]; then
2639 [ ${ESTAT} -eq 0 ] && echo Ok || echo >&2 'Errors occurred'