2 #@ Synopsis: ./cc-test.sh --check-only [s-mailx-binary]
3 #@ ./cc-test.sh --mae-test s-mailx-binary [:TESTNAME:]
4 #@ [./cc-test.sh # Note: performs hundreds of compilations!]
5 #@ The latter generates output files.
6 #@ TODO All ex0_test should say TESTNUMBER-estat instead of having own numbers
7 #@ TODO _All_ the tests should happen in a temporary subdir.
10 # Instead of figuring out the environment in here, require a configured build
11 # system and include that! Our makefile and configure ensure that this test
12 # does not run in the configured, but the user environment nonetheless!
14 if [ -f .
/mk-config.ev
]; then
16 elif [ -f snailmail.jpg
] && [ -f .obj
/mk-config.ev
]; then
20 echo >&2 'S-nail/S-mailx is not configured.'
21 echo >&2 'This test script requires the shell environment that only the'
22 echo >&2 'configuration script can figure out, even if it will be used to'
23 echo >&2 'test a different binary than the one that would be produced!'
24 echo >&2 'Hit RETURN to run "make config CONFIG=null'
26 make config CONFIG
=null
29 if [ -z "${MAILX__CC_TEST_RUNNING}" ]; then
30 MAILX__CC_TEST_RUNNING
=1
31 export MAILX__CC_TEST_RUNNING
32 exec "${SHELL}" "${i}${0}" "${@}"
35 # We need *stealthmua* regardless of $SOURCE_DATE_EPOCH, the program name as
36 # such is a compile-time variable
37 ARGS
='-:/ -# -Sdotlock-ignore-error -Sexpandaddr=restrict'
38 ARGS
="${ARGS}"' -Smime-encoding=quoted-printable -Snosave -Sstealthmua'
39 ADDARG_UNI
=-Sttycharset=UTF-8
43 ERR
=.
/.cc-test.err
# Covers only some which cannot be checksummed; not quoted!
45 #UTF8_LOCALE= autodetected unless set
47 # Note valgrind has problems with FDs in forked childs, which causes some tests
48 # to fail (the FD is rewound and thus will be dumped twice)
50 #MEMTESTER='valgrind --leak-check=full --log-file=.vl-%p '
52 ## -- (>8 -- 8<) -- ##
57 printf >&2 -- "${fmt}\\n" "${@}"
62 export ARGS ADDARG_UNI CONF BODY MBOX MAIL MAKE
awk cat cksum rm sed grep
66 # Wed Oct 2 01:50:07 UTC 1996
67 SOURCE_DATE_EPOCH
=844221007
69 export LC_ALL LANG TZ SOURCE_DATE_EPOCH
70 unset POSIXLY_CORRECT LOGNAME USER
73 echo >&2 'Synopsis: ./cc-test.sh --check-only s-mailx-binary'
74 echo >&2 'Synopsis: ./cc-test.sh --mae-test s-mailx-binary [:TESTNAME:]'
75 echo >&2 'Synopsis: ./cc-test.sh # (hundreds of compilation tests)'
79 CHECK_ONLY
= MAE_TEST
= MAILX
=
80 if [ "${1}" = --check-only ]; then
83 [ -x "${MAILX}" ] || usage
85 elif [ "${1}" = --mae-test ]; then
88 [ -x "${MAILX}" ] || usage
92 MAILX
="${MEMTESTER}${MAILX}"
95 if [ -n "${CHECK_ONLY}${MAE_TEST}" ] && [ -z "${UTF8_LOCALE}" ]; then
96 # Try ourselfs via nl_langinfo(CODESET) first (requires a new version)
97 if command -v "${RAWMAILX}" >/dev
/null
2>&1 &&
98 ("${RAWMAILX}" -:/ -Xxit) >/dev
/null
2>&1; then
99 i
=`LC_ALL=C.utf8 "${RAWMAILX}" ${ARGS} -X '
101 \if [ "${ttycharset}" @i=% utf ]
106 \wysh set LC_ALL=${1}
108 \eval xcall cset_test "${@}"
112 \call cset_test C.UTF-8 POSIX.utf8 POSIX.UTF-8 \
113 en_EN.utf8 en_EN.UTF-8 en_US.utf8 en_US.UTF-8
115 [ $?
-eq 0 ] && UTF8_LOCALE
=$i
118 if [ -z "${UTF8_LOCALE}" ] && (locale yesexpr
) >/dev
/null
2>&1; then
119 UTF8_LOCALE
=`locale -a | { m=
122 ${grep} -i -e utf8 -e utf-8; } >/dev/null 2>&1; then
125 ${grep} -e POSIX -e en_EN -e en_US; } >/dev/null 2>&1; then
138 trap "${rm} -rf \"${BODY}\" \"${MBOX}\" \"${ERR}\" \${TRAP_EXIT_ADDONS}" EXIT
139 trap "exit 1" HUP INT TERM
142 ( "${RAWMAILX}" ${ARGS} -X'echo $features' -Xx |
143 ${grep} +${1} ) >/dev
/null
2>&1
147 ${rm} -rf "${BODY}" "${MBOX}" ${TRAP_EXIT_ADDONS}
149 [ ${#} -gt 0 ] && printf '[%s]\n' "${1}"
156 [ ${#} -ge 1 ] && __from
=${1} ||
157 __from
='Silybum Marianum Tue Apr 17 15:55:01 2018'
158 [ ${#} -eq 2 ] && __to=${2} || __to="${MBOX}"
159 ${cat} <<-_EOT > .tmta.sh
161 ( echo 'From '"${__from}" && ${cat} && echo ) >> "${__to}"
167 restat=${?} tid=${1} eestat=${2} f=${3} s=${4}
168 [ "${eestat}" != - ] && [ "${restat}" != "${eestat}" ] &&
169 err "${tid}" 'unexpected exit status: '"${restat} != ${eestat}"
170 csum="`${cksum} < ${f}`"
171 if [ "${csum}" = "${s}" ]; then
173 printf '%s: ok\n' "${tid}"
177 printf '%s: error: checksum mismatch (got %s)\n' "${tid}" "${csum}"
180 if [ -n "${MAE_TEST}" ]; then
181 x=mae-test-`echo ${tid} | ${tr} "/:=" "__-
"`
182 ${cp} -f "${f}" ./"${x}"
184 if [ -n "${maex}" ] && [ -d ..
/.git
] &&
185 command -v diff >/dev
/null
2>&1 &&
186 (git rev-parse
--verify test-out
) >/dev
/null
2>&1 &&
187 git show test-out
:"${x}" > .
/"${x}".old
2>/dev
/null
; then
188 diff -ru .
/"${x}".old ./"${x}" > "${x}".
diff
195 printf '%s: error: %s\n' ${1} "${2}"
199 # $1=test name [$2=status]
201 [ ${#} -gt 1 ] && __qm__
=${2}
202 if [ ${__qm__} -ne 0 ]; then
203 err
$1 'unexpected non-0 exit status'
205 printf '%s: ok\n' "${1}"
210 # $1=test name [$2=status]
212 [ ${#} -gt 1 ] && __qm__
=${2}
213 if [ ${__qm__} -eq 0 ]; then
214 err
$1 'unexpected 0 exit status'
216 printf '%s: ok\n' "${1}"
220 if ( [ "$((1 + 1))" = 2 ] ) >/dev
/null
2>&1; then
222 echo "$((${1} + ${2}))"
226 echo `${awk} 'BEGIN{print '${1}' + '${2}'}'`
230 if ( [ "$((2 % 3))" = 2 ] ) >/dev
/null
2>&1; then
232 echo "$((${1} % ${2}))"
236 echo `${awk} 'BEGIN{print '${1}' % '${2}'}'`
241 # Basic behaviour tests
243 t_behave_X_opt_input_command_stack
247 t_behave_input_inject_semicolon_seq
248 t_behave_commandalias
252 t_behave_macro_param_shift
263 t_behave_record_a_resend
268 # FIXME t_behave_mlist
271 t_behave_message_injections
273 t_behave_compose_hooks
274 t_behave_C_opt_customhdr
275 t_behave_quote_a_cmd_escapes
277 t_behave_mass_recipients
278 t_behave_mime_types_load_control
279 t_behave_lreply_futh_rth_etc
281 t_behave_mime_if_not_ascii
282 t_behave_xxxheads_rfc2047
284 t_behave_iconv_mbyte_base64
285 t_behave_iconv_mainbody
286 t_behave_binary_mainbody
287 t_behave_q_t_etc_opts
292 t_behave_X_opt_input_command_stack
() {
293 t_prolog t_behave_X_opt_input_command_stack
295 ${cat} <<- '__EOT' > "${BODY}"
303 echo "define mac1 {";\
304 echo " echo mac1-1 via1 \$0";\
306 echo " echo mac1-2";\
308 echo " echo mac1-3";\
311 echo "define mac2 {";\
312 echo " echo mac2-1 via1 \$0";\
314 echo " echo mac2-2";\
320 echo echo 1-1-1 via1 \$0;\
332 # The -X option supports multiline arguments, and those can internally use
333 # reverse solidus newline escaping. And all -X options are joined...
335 < "${BODY}" ${MAILX} ${ARGS} \
350 echo "define mac1 {";\
351 echo " echo mac1-1 via2 \$0";\
353 echo " echo mac1-2";\
355 echo " echo mac1-3";\
358 echo "define mac2 {";\
359 echo " echo mac2-1 via2 \$0";\
361 echo " echo mac2-2";\
367 echo echo 1-1-1 via2 \$0;\
381 check behave:x_opt_input_command_stack 0 "${MBOX}" '1786542668 416'
386 t_behave_X_errexit() {
387 t_prolog t_behave_X_errexit
388 if have_feat uistrings; then :; else
389 echo 'behave:x_errexit: unsupported, skipped'
393 ${cat} <<- '__EOT' > "${BODY}"
399 </dev/null ${MAILX} ${ARGS} -Snomemdebug \
400 -X'echo one' -X' echos nono ' -X'echo two' \
402 check behave:x_errexit-1 0 "${MBOX}" '916157812 53'
404 </dev/null ${MAILX} ${ARGS} -X'source '"${BODY}" -Snomemdebug \
406 check behave:x_errexit-2 0 "${MBOX}" '916157812 53'
408 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u
-Snomemdebug \
410 check behave
:x_errexit-3
0 "${MBOX}" '916157812 53'
414 </dev
/null
${MAILX} ${ARGS} -Serrexit -Snomemdebug \
415 -X'echo one' -X' echos nono ' -X'echo two' \
417 check behave
:x_errexit-4
1 "${MBOX}" '2118430867 49'
419 </dev
/null
${MAILX} ${ARGS} -X'source '"${BODY}" -Serrexit -Snomemdebug \
421 check behave:x_errexit-5 1 "${MBOX}" '2118430867 49'
423 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u
-Serrexit -Snomemdebug \
425 check behave
:x_errexit-6
1 "${MBOX}" '12955965 172'
427 </dev
/null MAILRC
="${BODY}" ${MAILX} ${ARGS} -:u -Sposix -Snomemdebug \
429 check behave:x_errexit-7 1 "${MBOX}" '12955965 172'
431 ## Repeat 4-7 with ignerr set
433 ${sed} -e 's/^echos /ignerr echos /' < "${BODY}" > "${MBOX}"
435 </dev
/null
${MAILX} ${ARGS} -Serrexit -Snomemdebug \
436 -X'echo one' -X'ignerr echos nono ' -X'echo two' \
438 check behave
:x_errexit-8
0 "${BODY}" '916157812 53'
440 </dev
/null
${MAILX} ${ARGS} -X'source '"${MBOX}" -Serrexit -Snomemdebug \
442 check behave:x_errexit-9 0 "${BODY}" '916157812 53'
444 </dev/null MAILRC="${MBOX}" ${MAILX} ${ARGS} -:u
-Serrexit -Snomemdebug \
446 check behave
:x_errexit-10
0 "${BODY}" '916157812 53'
448 </dev
/null MAILRC
="${MBOX}" ${MAILX} ${ARGS} -:u -Sposix -Snomemdebug \
450 check behave:x_errexit-11 0 "${BODY}" '916157812 53'
455 t_behave_S_freeze() {
456 t_prolog t_behave_S_freeze
460 # Test basic assumption
461 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} \
462 -X'echo asksub<$asksub> dietcurd<$dietcurd>' \
464 check behave
:s_freeze-1
0 "${MBOX}" '270686329 21'
467 ${cat} <<- '__EOT' > "${BODY}"
472 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
473 -Snoasksub -Sasksub -Snoasksub \
474 -X'echo asksub<$asksub>' -X'set asksub' -X'echo asksub<$asksub>' \
476 check behave
:s_freeze-2
0 "${MBOX}" '3182942628 37'
478 ${cat} <<- '__EOT' > "${BODY}"
483 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
484 -Snoasksub -Sasksub \
485 -X'echo asksub<$asksub>' -X'unset asksub' -X'echo asksub<$asksub>' \
487 check behave
:s_freeze-3
0 "${MBOX}" '2006554293 39'
490 ${cat} <<- '__EOT' > "${BODY}"
491 echo dietcurd<$dietcurd>
493 echo dietcurd<$dietcurd>
495 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
496 -Sdietcurd=strawberry
-Snodietcurd -Sdietcurd=vanilla \
497 -X'echo dietcurd<$dietcurd>' -X'unset dietcurd' \
498 -X'echo dietcurd<$dietcurd>' \
500 check behave
:s_freeze-4
0 "${MBOX}" '1985768109 65'
502 ${cat} <<- '__EOT' > "${BODY}"
503 echo dietcurd<$dietcurd>
505 echo dietcurd<$dietcurd>
507 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
508 -Sdietcurd=strawberry
-Snodietcurd \
509 -X'echo dietcurd<$dietcurd>' -X'set dietcurd=vanilla' \
510 -X'echo dietcurd<$dietcurd>' \
512 check behave
:s_freeze-5
0 "${MBOX}" '151574279 51'
514 # TODO once we have a detached one with env=1..
515 if [ -n "`</dev/null ${MAILX} ${ARGS} -X'!echo \$TERM' -Xx`" ]; then
516 echo 'behave:s_freeze-{6,7}: shell sets $TERM, skipped'
518 ${cat} <<- '__EOT' > "${BODY}"
519 !echo "shell says TERM<$TERM>"
521 !echo "shell says TERM<$TERM>"
523 !echo "shell says TERM<$TERM>"
525 !echo "shell says TERM<$TERM>"
527 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
528 -STERM=strawberry
-SnoTERM -STERM=vanilla \
529 -X'echo mail<$TERM>' -X'unset TERM' \
530 -X'!echo "shell says TERM<$TERM>"' -X'echo TERM<$TERM>' \
532 check behave
:s_freeze-6
0 "${MBOX}" '1211476036 167'
534 ${cat} <<- '__EOT' > "${BODY}"
535 !echo "shell says TERM<$TERM>"
537 !echo "shell says TERM<$TERM>"
539 !echo "shell says TERM<$TERM>"
541 !echo "shell says TERM<$TERM>"
543 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
544 -STERM=strawberry
-SnoTERM \
545 -X'echo TERM<$TERM>' -X'set TERM=vanilla' \
546 -X'!echo "shell says TERM<$TERM>"' -X'echo TERM<$TERM>' \
548 check behave
:s_freeze-7
0 "${MBOX}" '3365080441 132'
556 t_prolog t_behave_wysh
558 ${cat} <<- '__EOT' > "${BODY}"
577 echo 'a${DIET}b${TIED}c\${DIET}d\${TIED}e' # COMMENT
578 echo "a${DIET}b${TIED}c\${DIET}d\${TIED}e"
579 echo $'a${DIET}b${TIED}c\${DIET}d\${TIED}e'
581 echo a$'\101\0101\x41\u0041\u41\U00000041\U41'c
582 echo a$'\u0041\u41\u0C1\U00000041\U41'c
605 echo a$'b\U0000000'dt
606 echo a$'b\U00000000'du
616 if [ -z "${UTF8_LOCALE}" ]; then
617 echo 'Skip behave:wysh_unicode, no UTF8_LOCALE'
619 < "${BODY}" DIET=CURD TIED= \
620 LC_ALL=${UTF8_LOCALE} ${MAILX} ${ARGS} > "${MBOX}" 2>>${ERR}
621 check behave:wysh_unicode 0 "${MBOX}" '475805847 317'
624 < "${BODY}" DIET=CURD TIED= ${MAILX} ${ARGS} > "${MBOX}" 2>>${ERR}
625 check behave:wysh_c 0 "${MBOX}" '1473887148 321'
627 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
628 wysh set mager='\hey\'
630 wysh set mager="\hey\\"
632 wysh set mager=$'\hey\\'
635 check behave:wysh-3 0 "${MBOX}" '1289698238 69'
640 t_behave_input_inject_semicolon_seq() {
641 t_prolog t_behave_input_inject_semicolon_seq
643 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
648 echon this_is_mymac;call mydeepmac;echon ';';
650 echon one';';call mymac;echon two";";call mymac;echo three$';';
652 echon this_is_mymac;call mydeepmac;echon ,TOO'!;';
654 echon one';';call mymac;echon two";";call mymac;echo three$';';
657 check behave:input_inject_semicolon_seq 0 "${MBOX}" '512117110 140'
662 t_behave_commandalias() {
663 t_prolog t_behave_commandalias
665 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
666 commandalias echo echo hoho
670 commandalias XxX XxXx
671 commandalias XxXx XxXxX
672 commandalias XxXxX XxXxXx
673 commandalias XxXxXx echo huhu
674 commandalias XxXxXxX echo huhu
676 commandalias XxXxXx XxXxXxX
679 commandalias XxXxXx echo huhu
683 check behave:commandalias 0 "${MBOX}" '1638809585 36'
689 t_prolog t_behave_ifelse
691 # Nestable conditions test
692 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
714 if $dietcurd == 'yoho'
719 if $dietcurd @== 'Yoho'
724 if $dietcurd == 'Yoho'
729 if $dietcurd != 'yoho'
734 if $dietcurd @!= 'Yoho'
739 if $dietcurd != 'Yoho'
800 if $dietcurd == 'yohu'
802 elif $dietcurd == 'yoha'
804 elif $dietcurd == 'yohe'
806 elif $dietcurd == 'yoho'
808 if $dietcurd == 'yohu'
810 elif $dietcurd == 'yoha'
812 elif $dietcurd == 'yohe'
814 elif $dietcurd == 'yoho'
816 if $dietcurd == 'yohu'
818 elif $dietcurd == 'yoha'
820 elif $dietcurd == 'yohe'
822 elif $dietcurd == 'yoho'
971 set diet=abc curd=abc
977 set diet=abc curd=abcd
983 # 1. Shitty grouping capabilities as of today
984 unset diet curd ndefined
985 if [ [ false ] || [ false ] || [ true ] ] && [ [ false ] || [ true ] ] && \
991 if [ [ [ [ 0 ] || [ 1 ] ] && [ [ 1 ] || [ 0 ] ] ] && [ 1 ] ] && [ yes ]
996 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] ]
1001 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] ]
1006 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] || [ 1 ] ] && [ no ]
1011 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] || [ 1 ] ] \
1012 && [ no ] || [ yes ]
1017 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 1 ] ]
1022 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 0 ] ]
1027 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 0 ] ] && [ 1 ] ] ] && [ 1 ] ]
1032 if [ [ [ [ [ [ [ 0 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 1 ] ]
1037 if [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] && [ 0 ]
1042 if [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] && [ 1 ]
1047 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ]
1052 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 1 ]
1057 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ] || [ 1 ] && [ 0 ]
1062 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ] || [ 1 ] && [ 1 ]
1068 if [ [ $diet == 'yo' ] && [ $curd == 'ho' ] ] && [ $ndefined ]
1074 if [ [ $diet == 'yo' ] && [ $curd == 'ho' ] ] && [ $ndefined ]
1079 # 2. Shitty grouping capabilities as of today
1080 unset diet curd ndefined
1081 if [ false || false || true ] && [ false || true ] && yes
1086 if [ [ [ 0 || 1 ] && [ 1 || 0 ] ] && 1 ] && [ yes ]
1091 if [ 1 || 0 || 0 || 0 ]
1096 if [ 1 || 0 || 0 || 0 || [ 1 ] ]
1101 if [ 1 || 0 || 0 || 0 || [ 1 ] || 1 ] && no
1106 if [ 1 || 0 || 0 || 0 || 1 || [ 1 ] ] && no || [ yes ]
1111 if [ [ [ [ [ [ 1 ] && 1 ] && 1 ] && 1 ] ] && [ 1 ] ]
1116 if [ [ [ [ [ [ 1 ] && 1 ] && 1 ] && [ 1 ] ] ] && 0 ]
1121 if [ [ [ [ [ [ [ 1 ] ] && 1 ] && 0 ] && [ 1 ] ] ] && 1 ]
1126 if [ [ [ [ [ [ 0 ] && 1 ] && 1 ] && 1 ] ] && 1 ]
1131 if 1 || 0 || 0 || 0 && 0
1136 if 1 || 0 || 0 || 0 && 1
1141 if 0 || 0 || 0 || 1 && 0
1146 if 0 || 0 || 0 || 1 && 1
1151 if 0 || 0 || 0 || 1 && 0 || 1 && 0
1156 if 0 || 0 || 0 || 1 && 0 || 1 && 1
1162 if [ $diet == 'yo' && $curd == 'ho' ] && $ndefined
1167 if $diet == 'yo' && $curd == 'ho' && $ndefined
1173 if [ $diet == 'yo' && $curd == 'ho' ] && $ndefined
1178 if $diet == 'yo' && $curd == 'ho' && $ndefined
1183 if [ [ [ [ [ [ $diet == 'yo' && $curd == 'ho' && $ndefined ] ] ] ] ] ]
1188 # Some more en-braced variables
1190 if ${diet} == ${curd}
1195 if ${diet} != ${curd}
1211 if ! 0 && ! ! 1 && ! ! ! ! 2 && 3
1216 if ! 0 && ! [ ! 1 ] && ! [ ! [ ! [ ! 2 ] ] ] && 3
1221 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
1226 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && ! 3
1231 if [ ! 0 ] && [ ! [ ! 1 ] ] && ! [ [ ! [ ! [ ! [ 2 ] ] ] ] ] && ! 3
1236 if [ ! 0 ] && ! [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
1241 if ! [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
1246 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] || 3
1251 if [ ! 0 ] && [ ! ! [ ! ! 1 ] ] && [ ! ! [ ! ! [ ! ! [ ! ! [ 2 ] ] ] ] ]
1257 if ! 0 && ! ! 1 && ! ! ! 0 && 3
1262 if ! 0 && ! [ ! 1 ] && ! [ ! [ ! [ 0 ] ] ] && 3
1267 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ [ 0 ] ] ] ] ] && 3
1272 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! ! [ ! [ ! 0 ] ] ] ] && ! 3
1277 if [ ! 0 ] && [ ! [ ! 1 ] ] && ! [ ! [ ! [ ! [ ! 0 ] ] ] ] && 3
1282 if [ ! 0 ] && ! [ ! [ ! 1 ] ] && [ ! ! [ ! [ ! [ ! [ 0 ] ] ] ] ] && 3
1287 if ! [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! ! 0 ] ] ] ] && 3
1292 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ ! 0 ] ] ] ] ] || 3
1297 if [ ! 0 ] && [ ! ! [ ! ! 1 ] ] && [ ! ! [ ! ! [ ! ! [ ! [ 0 ] ] ] ] ]
1304 check behave:if-normal 0 "${MBOX}" '1688759742 719'
1306 if have_feat regex; then
1307 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
1309 if $dietcurd =~ '^yo.*'
1314 if $dietcurd =~ '^Yo.*'
1319 if $dietcurd @=~ '^Yo.*'
1324 if $dietcurd =~ '^yOho.+'
1329 if $dietcurd @!~ '.*Ho$'
1334 if $dietcurd !~ '.+yohO$'
1339 if [ $dietcurd @i!~ '.+yoho$' ]
1344 if ! [ $dietcurd @i=~ '.+yoho$' ]
1349 if ! ! [ $dietcurd @i!~ '.+yoho$' ]
1354 if ! [ ! [ $dietcurd @i!~ '.+yoho$' ] ]
1359 if [ ! [ ! [ $dietcurd @i!~ '.+yoho$' ] ] ]
1364 if ! [ ! [ ! [ $dietcurd !~ '.+yoho$' ] ] ]
1369 if ! ! ! $dietcurd !~ '.+yoho$'
1374 if ! ! ! $dietcurd =~ '.+yoho$'
1379 if ! [ ! ! [ ! [ $dietcurd !~ '.+yoho$' ] ] ]
1384 set diet=abc curd='^abc$'
1390 set diet=abc curd='^abcd$'
1398 check behave:if-regex 0 "${MBOX}" '1115671789 95'
1400 printf 'behave:if-regex: unsupported, skipped\n'
1406 t_behave_localopts() {
1407 t_prolog t_behave_localopts
1409 # Nestable conditions test
1410 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
1425 echo $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2
1430 echo $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2
1431 echo "$gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2"
1440 echo active trouble: $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t3
1442 echo active null: $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t3
1451 wysh set y=$1; shift; eval localopts $y; localopts $1; shift
1458 wysh set y=$1; shift; eval localopts $y; localopts $1; shift
1465 echo ----- $1: $2 -> $3 -> $4
1473 call llx
'call off' on on on
1474 call llx
'call off' off on on
1475 call llx
'call off' on off on
1476 call llx
'call off' on off off
1477 localopts call-fixate on
1478 call llx
'call-fixate on' on on on
1479 call llx
'call-fixate on' off on on
1480 call llx
'call-fixate on' on off on
1481 call llx
'call-fixate on' on off off
1482 unset x
;localopts call on
1483 call llx
'call on' on on on
1484 call llx
'call on' off on on
1485 call llx
'call on' on off on
1486 call llx
'call on' on off off
1491 check behave
:localopts
0 "${MBOX}" '4016155249 1246'
1497 t_prolog t_behave_local
1499 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
1527 echo ------- global-1 du=$du
1529 echo ------- global-2 du=$du
1532 echo ------- global-3 du=$du
1534 echo ------- global-4 du=$du
1536 echo ------- global-5 du=$du
1539 check behave:local-1 0 "${MBOX}" '2411598140 641'
1544 t_behave_macro_param_shift() {
1545 t_prolog t_behave_macro_param_shift
1547 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>>${ERR}
1550 echo t2.0 has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1555 echo t2.1 has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1556 if [ $# > 1 ] || [ $ignerr == '' ]
1561 echo t2.2:$? has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1563 echo t2.3:$? has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1567 echo t2.4:$? has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1572 call t2 1 you get four args
1573 echo t1.1: $?';' ignerr ($ignerr) should not exist
1574 call t2 1 you get 'three args'
1575 echo t1.2: $?';' ignerr ($ignerr) should not exist
1576 call t2 1 you 'get two args'
1577 echo t1.3: $?';' ignerr ($ignerr) should not exist
1578 call t2 1 'you get one arg'
1579 echo t1.4: $?';' ignerr ($ignerr) should not exist
1580 ignerr call t2 '' 'you get one arg'
1581 echo t1.5: $?';' ignerr ($ignerr) should not exist
1586 check behave:macro_param_shift 0 "${MBOX}" '1402489146 1682'
1591 t_behave_addrcodec() {
1592 t_prolog t_behave_addrcodec
1594 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
1595 vput addrcodec res e
1 <doog@def
>
1596 echo $?
/$^ERRNAME
$res
1597 eval vput addrcodec res d
$res
1598 echo $?
/$^ERRNAME
$res
1599 vput addrcodec res e
2 .
<doog@def
>
1600 echo $?
/$^ERRNAME
$res
1601 eval vput addrcodec res d
$res
1602 echo $?
/$^ERRNAME
$res
1603 vput addrcodec res e
3 Sauer Dr.
<doog@def
>
1604 echo $?
/$^ERRNAME
$res
1605 eval vput addrcodec res d
$res
1606 echo $?
/$^ERRNAME
$res
1607 vput addrcodec res e
3.50 Sauer
(Ma
) Dr.
<doog@def
>
1608 echo $?
/$^ERRNAME
$res
1609 eval vput addrcodec res d
$res
1610 echo $?
/$^ERRNAME
$res
1611 vput addrcodec res e
3.51 Sauer
(Ma
) "Dr." <doog@def
>
1612 echo $?
/$^ERRNAME
$res
1613 eval vput addrcodec res d
$res
1614 echo $?
/$^ERRNAME
$res
1616 vput addrcodec res
+e
4 Sauer
(Ma
) Dr.
<doog@def
>
1617 echo $?
/$^ERRNAME
$res
1618 eval vput addrcodec res d
$res
1619 echo $?
/$^ERRNAME
$res
1620 vput addrcodec res
+e
5 Sauer
(Ma
) Braten Dr.
<doog@def
>
1621 echo $?
/$^ERRNAME
$res
1622 eval vput addrcodec res d
$res
1623 echo $?
/$^ERRNAME
$res
1624 vput addrcodec res
+e
6 Sauer
(Ma
) Braten Dr.
(Heu
) <doog@def
>
1625 echo $?
/$^ERRNAME
$res
1626 eval vput addrcodec res d
$res
1627 echo $?
/$^ERRNAME
$res
1628 vput addrcodec res
+e
7 Sauer
(Ma
) Braten Dr.
(Heu
) <doog@def
> (bu
)
1629 echo $?
/$^ERRNAME
$res
1630 eval vput addrcodec res d
$res
1631 echo $?
/$^ERRNAME
$res
1632 vput addrcodec res
+e
8 \
1633 Dr. Sauer
(Ma
) Braten Dr.
(Heu
) <doog@def
> (bu
) Boom. Boom
1634 echo $?
/$^ERRNAME
$res
1635 eval vput addrcodec res d
$res
1636 echo $?
/$^ERRNAME
$res
1637 vput addrcodec res
+e
9 Dr.Sauer
(Ma
)Braten Dr.
(Heu
) <doog@def
>
1638 echo $?
/$^ERRNAME
$res
1639 eval vput addrcodec res d
$res
1640 echo $?
/$^ERRNAME
$res
1641 vput addrcodec res
+e
10 (Ma
)Braten Dr.
(Heu
) <doog@def
>
1642 echo $?
/$^ERRNAME
$res
1643 eval vput addrcodec res d
$res
1644 echo $?
/$^ERRNAME
$res
1645 vput addrcodec res
+e
11 (Ma
)Braten Dr
"." (Heu
) <doog@def
>
1646 echo $?
/$^ERRNAME
$res
1647 eval vput addrcodec res d
$res
1648 echo $?
/$^ERRNAME
$res
1649 vput addrcodec res
+e
12 Dr. Sauer
(Ma
) Braten Dr.
(u
) <doog@def
>
1650 echo $?
/$^ERRNAME
$res
1651 eval vput addrcodec res d
$res
1652 echo $?
/$^ERRNAME
$res
1653 vput addrcodec res
+e
13(Ma
)Braten Dr.
(Heu
) <doog@def
>
1654 echo $?
/$^ERRNAME
$res
1655 eval vput addrcodec res d
$res
1656 echo $?
/$^ERRNAME
$res
1657 vput addrcodec res
+e
14 Hey
, Du
<doog@def
> Wie
() findet Dr. das?
()
1658 echo $?
/$^ERRNAME
$res
1659 eval vput addrcodec res d
$res
1660 echo $?
/$^ERRNAME
$res
1661 vput addrcodec res
+e
15 \
1662 Hey
, Du
<doog@def
> Wie
() findet
"" Dr.
"" das?
()
1663 echo $?
/$^ERRNAME
$res
1664 eval vput addrcodec res d
$res
1665 echo $?
/$^ERRNAME
$res
1666 vput addrcodec res
+e
16 \
1667 "Hey," "Du" <doog@def
> "Wie()" findet
"" Dr.
"" das?
()
1668 echo $?
/$^ERRNAME
$res
1669 eval vput addrcodec res d
$res
1670 echo $?
/$^ERRNAME
$res
1671 vput addrcodec res
+e
17 \
1672 "Hey" Du
<doog@def
> "Wie() findet " " Dr. """ das?
()
1673 echo $?
/$^ERRNAME
$res
1674 eval vput addrcodec res d
$res
1675 echo $?
/$^ERRNAME
$res
1676 vput addrcodec res
+e
18 \
1677 <doog@def
> "Hey" Du
"Wie() findet " " Dr. """ das?
()
1678 echo $?
/$^ERRNAME
$res
1679 eval vput addrcodec res d
$res
1680 echo $?
/$^ERRNAME
$res
1681 vput addrcodec res
+e
19 Hey\
,\" <doog@def
> "Wie()" findet
\" Dr.
\" das?
1682 echo $?
/$^ERRNAME
$res
1683 eval vput addrcodec res d
$res
1684 echo $?
/$^ERRNAME
$res
1686 vput addrcodec res
++e
20 Hey\
,\" <doog@def
> "Wie()" findet
\" Dr.
\" das?
1687 echo $?
/$^ERRNAME
$res
1688 vput addrcodec res
++e
21 Hey\
,\"" <doog@def> "Wie
()" findet \" Dr. \" das?
1689 echo $?/$^ERRNAME $res
1690 eval vput addrcodec res d $res
1691 echo $?/$^ERRNAME $res
1693 vput addrcodec res +++e 22 Hey\\,\" <doog@def> "Wie
()" findet \" Dr. \" das?
1694 echo $?/$^ERRNAME $res
1695 eval vput addrcodec res d $res
1696 echo $?/$^ERRNAME $res
1698 vput addrcodec res s \
1699 "23 Hey
\\,\\\" \"Wie
" () "\" findet
\\\" Dr.
\\\" das?
" <doog@def>
1700 echo $?/$^ERRNAME $res
1702 # Fix for [f3852f88]
1703 vput addrcodec res ++e <from2@exam.ple> 100 (comment) "Quot
(e
)d
"
1704 echo $?/$^ERRNAME $res
1705 eval vput addrcodec res d $res
1706 echo $?/$^ERRNAME $res
1707 vput addrcodec res e <from2@exam.ple> 100 (comment) "Quot
(e
)d
"
1708 echo $?/$^ERRNAME $res
1709 eval vput addrcodec res d $res
1710 echo $?/$^ERRNAME $res
1713 check behave:addrcodec-1 0 "${MBOX}" '1047317989 2612'
1715 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
1717 mlsubscribe isa2@list
1719 vput addrcodec res skin Hey
\\,\" <isa0@list
> "Wie()" find \" Dr.
\" das?
1720 echo $?
/$^ERRNAME
$res
1721 vput addrcodec res skinlist Hey
\\,\" <isa0@list
> "Wie()" find \" Dr.
\" das?
1722 echo $?
/$^ERRNAME
$res
1723 vput addrcodec res skin Hey
\\,\" <isa1@list
> "Wie()" find \" Dr.
\" das?
1724 echo $?
/$^ERRNAME
$res
1725 vput addrcodec res skinlist Hey
\\,\" <isa1@list
> "Wie()" find \" Dr.
\" das?
1726 echo $?
/$^ERRNAME
$res
1727 vput addrcodec res skin Hey
\\,\" <isa2@list
> "Wie()" find \" Dr.
\" das?
1728 echo $?
/$^ERRNAME
$res
1729 vput addrcodec res skinlist Hey
\\,\" <isa2@list
> "Wie()" find \" Dr.
\" das?
1730 echo $?
/$^ERRNAME
$res
1733 check behave
:addrcodec-2
0 "${MBOX}" '1391779299 104'
1735 if have_feat idna
; then
1736 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} ${ADDARG_UNI} > "${MBOX}" 2>&1
1737 vput addrcodec res e (heu) <du@blödiän> "stroh
" du
1738 echo $?/$^ERRNAME $res
1739 eval vput addrcodec res d $res
1740 echo $?/$^ERRNAME $res
1741 vput addrcodec res e <du@blödiän> du
1742 echo $?/$^ERRNAME $res
1743 eval vput addrcodec res d $res
1744 echo $?/$^ERRNAME $res
1745 vput addrcodec res e du <du@blödiän>
1746 echo $?/$^ERRNAME $res
1747 eval vput addrcodec res d $res
1748 echo $?/$^ERRNAME $res
1749 vput addrcodec res e <du@blödiän>
1750 echo $?/$^ERRNAME $res
1751 eval vput addrcodec res d $res
1752 echo $?/$^ERRNAME $res
1753 vput addrcodec res e du@blödiän
1754 echo $?/$^ERRNAME $res
1755 eval vput addrcodec res d $res
1756 echo $?/$^ERRNAME $res
1759 check behave:addrcodec-idna 0 "${MBOX}" '498775983 326'
1761 printf 'behave:addrcodec-idna: unsupported, skipped\n'
1768 t_prolog t_behave_vexpr
1770 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>>${ERR}
1772 vput vexpr res = 9223372036854775807
1773 echo $?/$^ERRNAME $res
1774 vput vexpr res = 9223372036854775808
1775 echo $?/$^ERRNAME $res
1776 vput vexpr res = u9223372036854775808
1777 echo $?/$^ERRNAME $res
1778 vput vexpr res @= 9223372036854775808
1779 echo $?/$^ERRNAME $res
1780 vput vexpr res = -9223372036854775808
1781 echo $?/$^ERRNAME $res
1782 vput vexpr res = -9223372036854775809
1783 echo $?/$^ERRNAME $res
1784 vput vexpr res @= -9223372036854775809
1785 echo $?/$^ERRNAME $res
1786 vput vexpr res = U9223372036854775809
1787 echo $?/$^ERRNAME $res
1790 0b0111111111111111111111111111111111111111111111111111111111111111
1791 echo $?/$^ERRNAME $res
1793 S0b1000000000000000000000000000000000000000000000000000000000000000
1794 echo $?/$^ERRNAME $res
1796 S0b1000000000000000000000000000000000000000000000000000000000000000
1797 echo $?/$^ERRNAME $res
1799 U0b1000000000000000000000000000000000000000000000000000000000000000
1800 echo $?/$^ERRNAME $res
1802 0b1000000000000000000000000000000000000000000000000000000000000000
1803 echo $?/$^ERRNAME $res
1805 0b1000000000000000000000000000000000000000000000000000000000000000
1806 echo $?/$^ERRNAME $res
1808 -0b1000000000000000000000000000000000000000000000000000000000000000
1809 echo $?/$^ERRNAME $res
1811 S0b1000000000000000000000000000000000000000000000000000000000000001
1812 echo $?/$^ERRNAME $res
1814 S0b1000000000000000000000000000000000000000000000000000000000000001
1815 echo $?/$^ERRNAME $res
1817 -0b1000000000000000000000000000000000000000000000000000000000000001
1818 echo $?/$^ERRNAME $res
1820 U0b1000000000000000000000000000000000000000000000000000000000000001
1821 echo $?/$^ERRNAME $res
1823 vput vexpr res = 0777777777777777777777
1824 echo $?/$^ERRNAME $res
1825 vput vexpr res = S01000000000000000000000
1826 echo $?/$^ERRNAME $res
1827 vput vexpr res @= S01000000000000000000000
1828 echo $?/$^ERRNAME $res
1829 vput vexpr res = U01000000000000000000000
1830 echo $?/$^ERRNAME $res
1831 vput vexpr res = 01000000000000000000000
1832 echo $?/$^ERRNAME $res
1833 vput vexpr res @= 01000000000000000000000
1834 echo $?/$^ERRNAME $res
1835 vput vexpr res = -01000000000000000000000
1836 echo $?/$^ERRNAME $res
1837 vput vexpr res = S01000000000000000000001
1838 echo $?/$^ERRNAME $res
1839 vput vexpr res @= S01000000000000000000001
1840 echo $?/$^ERRNAME $res
1841 vput vexpr res @= -01000000000000000000001
1842 echo $?/$^ERRNAME $res
1843 vput vexpr res = U01000000000000000000001
1844 echo $?/$^ERRNAME $res
1846 vput vexpr res = 0x7FFFFFFFFFFFFFFF
1847 echo $?/$^ERRNAME $res
1848 vput vexpr res = S0x8000000000000000
1849 echo $?/$^ERRNAME $res
1850 vput vexpr res @= S0x8000000000000000
1851 echo $?/$^ERRNAME $res
1852 vput vexpr res = U0x8000000000000000
1853 echo $?/$^ERRNAME $res
1854 vput vexpr res = 0x8000000000000000
1855 echo $?/$^ERRNAME $res
1856 vput vexpr res @= 0x8000000000000000
1857 echo $?/$^ERRNAME $res
1858 vput vexpr res = -0x8000000000000000
1859 echo $?/$^ERRNAME $res
1860 vput vexpr res = S0x8000000000000001
1861 echo $?/$^ERRNAME $res
1862 vput vexpr res @= S0x8000000000000001
1863 echo $?/$^ERRNAME $res
1864 vput vexpr res @= -0x8000000000000001
1865 echo $?/$^ERRNAME $res
1866 vput vexpr res = u0x8000000000000001
1867 echo $?/$^ERRNAME $res
1870 echo $?/$^ERRNAME $res
1872 echo $?/$^ERRNAME $res
1874 echo $?/$^ERRNAME $res
1876 vput vexpr res + 0 0
1877 echo $?/$^ERRNAME $res
1878 vput vexpr res + 0 1
1879 echo $?/$^ERRNAME $res
1880 vput vexpr res + 1 1
1881 echo $?/$^ERRNAME $res
1883 vput vexpr res + 9223372036854775807 0
1884 echo $?/$^ERRNAME $res
1885 vput vexpr res + 9223372036854775807 1
1886 echo $?/$^ERRNAME $res
1887 vput vexpr res @+ 9223372036854775807 1
1888 echo $?/$^ERRNAME $res
1889 vput vexpr res + 0 9223372036854775807
1890 echo $?/$^ERRNAME $res
1891 vput vexpr res + 1 9223372036854775807
1892 echo $?/$^ERRNAME $res
1893 vput vexpr res @+ 1 9223372036854775807
1894 echo $?/$^ERRNAME $res
1896 vput vexpr res + -9223372036854775808 0
1897 echo $?/$^ERRNAME $res
1898 vput vexpr res + -9223372036854775808 -1
1899 echo $?/$^ERRNAME $res
1900 vput vexpr res @+ -9223372036854775808 -1
1901 echo $?/$^ERRNAME $res
1902 vput vexpr res + 0 -9223372036854775808
1903 echo $?/$^ERRNAME $res
1904 vput vexpr res + -1 -9223372036854775808
1905 echo $?/$^ERRNAME $res
1906 vput vexpr res @+ -1 -9223372036854775808
1907 echo $?/$^ERRNAME $res
1909 vput vexpr res - 0 0
1910 echo $?/$^ERRNAME $res
1911 vput vexpr res - 0 1
1912 echo $?/$^ERRNAME $res
1913 vput vexpr res - 1 1
1914 echo $?/$^ERRNAME $res
1916 vput vexpr res - 9223372036854775807 0
1917 echo $?/$^ERRNAME $res
1918 vput vexpr res - 9223372036854775807 -1
1919 echo $?/$^ERRNAME $res
1920 vput vexpr res @- 9223372036854775807 -1
1921 echo $?/$^ERRNAME $res
1922 vput vexpr res - 0 9223372036854775807
1923 echo $?/$^ERRNAME $res
1924 vput vexpr res - -1 9223372036854775807
1925 echo $?/$^ERRNAME $res
1926 vput vexpr res - -2 9223372036854775807
1927 echo $?/$^ERRNAME $res
1928 vput vexpr res @- -2 9223372036854775807
1929 echo $?/$^ERRNAME $res
1931 vput vexpr res - -9223372036854775808 +0
1932 echo $?/$^ERRNAME $res
1933 vput vexpr res - -9223372036854775808 +1
1934 echo $?/$^ERRNAME $res
1935 vput vexpr res @- -9223372036854775808 +1
1936 echo $?/$^ERRNAME $res
1937 vput vexpr res - 0 -9223372036854775808
1938 echo $?/$^ERRNAME $res
1939 vput vexpr res - +1 -9223372036854775808
1940 echo $?/$^ERRNAME $res
1941 vput vexpr res @- +1 -9223372036854775808
1942 echo $?/$^ERRNAME $res
1944 vput vexpr res + -13 -2
1945 echo $?/$^ERRNAME $res
1946 vput vexpr res - 0 0
1947 echo $?/$^ERRNAME $res
1948 vput vexpr res - 0 1
1949 echo $?/$^ERRNAME $res
1950 vput vexpr res - 1 1
1951 echo $?/$^ERRNAME $res
1952 vput vexpr res - -13 -2
1953 echo $?/$^ERRNAME $res
1955 vput vexpr res * 0 0
1956 echo $?/$^ERRNAME $res
1957 vput vexpr res * 0 1
1958 echo $?/$^ERRNAME $res
1959 vput vexpr res * 1 1
1960 echo $?/$^ERRNAME $res
1961 vput vexpr res * -13 -2
1962 echo $?/$^ERRNAME $res
1964 vput vexpr res / 0 0
1965 echo $?/$^ERRNAME $res
1966 vput vexpr res / 0 1
1967 echo $?/$^ERRNAME $res
1968 vput vexpr res / 1 1
1969 echo $?/$^ERRNAME $res
1970 vput vexpr res / -13 -2
1971 echo $?/$^ERRNAME $res
1973 vput vexpr res % 0 0
1974 echo $?/$^ERRNAME $res
1975 vput vexpr res % 0 1
1976 echo $?/$^ERRNAME $res
1977 vput vexpr res % 1 1
1978 echo $?/$^ERRNAME $res
1979 vput vexpr res % -13 -2
1980 echo $?/$^ERRNAME $res
1983 check behave:vexpr-numeric 0 "${MBOX}" '960821755 1962'
1985 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
1986 vput vexpr res
find 'bananarama' 'nana'
1987 echo $?
/$^ERRNAME
:$res:
1988 vput vexpr res
find 'bananarama' 'bana'
1989 echo $?
/$^ERRNAME
:$res:
1990 vput vexpr res
find 'bananarama' 'Bana'
1991 echo $?
/$^ERRNAME
:$res:
1992 vput vexpr res
find 'bananarama' 'rama'
1993 echo $?
/$^ERRNAME
:$res:
1995 vput vexpr res ifind
'bananarama' 'nana'
1996 echo $?
/$^ERRNAME
:$res:
1997 vput vexpr res ifind
'bananarama' 'bana'
1998 echo $?
/$^ERRNAME
:$res:
1999 vput vexpr res ifind
'bananarama' 'Bana'
2000 echo $?
/$^ERRNAME
:$res:
2001 vput vexpr res ifind
'bananarama' 'rama'
2002 echo $?
/$^ERRNAME
:$res:
2004 vput vexpr res substring
'bananarama' 1
2005 echo $?
/$^ERRNAME
:$res:
2006 vput vexpr res substring
'bananarama' 3
2007 echo $?
/$^ERRNAME
:$res:
2008 vput vexpr res substring
'bananarama' 5
2009 echo $?
/$^ERRNAME
:$res:
2010 vput vexpr res substring
'bananarama' 7
2011 echo $?
/$^ERRNAME
:$res:
2012 vput vexpr res substring
'bananarama' 9
2013 echo $?
/$^ERRNAME
:$res:
2014 vput vexpr res substring
'bananarama' 10
2015 echo $?
/$^ERRNAME
:$res:
2016 vput vexpr res substring
'bananarama' 1 3
2017 echo $?
/$^ERRNAME
:$res:
2018 vput vexpr res substring
'bananarama' 3 3
2019 echo $?
/$^ERRNAME
:$res:
2020 vput vexpr res substring
'bananarama' 5 3
2021 echo $?
/$^ERRNAME
:$res:
2022 vput vexpr res substring
'bananarama' 7 3
2023 echo $?
/$^ERRNAME
:$res:
2024 vput vexpr res substring
'bananarama' 9 3
2025 echo $?
/$^ERRNAME
:$res:
2026 vput vexpr res substring
'bananarama' 10 3
2027 echo $?
/$^ERRNAME
:$res:
2029 vput vexpr res substring
'bananarama' -1
2030 echo $?
/$^ERRNAME
:$res:
2031 vput vexpr res substring
'bananarama' -3
2032 echo $?
/$^ERRNAME
:$res:
2033 vput vexpr res substring
'bananarama' -5
2034 echo $?
/$^ERRNAME
:$res:
2035 vput vexpr res substring
'bananarama' -7
2036 echo $?
/$^ERRNAME
:$res:
2037 vput vexpr res substring
'bananarama' -9
2038 echo $?
/$^ERRNAME
:$res:
2039 vput vexpr res substring
'bananarama' -10
2040 echo $?
/$^ERRNAME
:$res:
2041 vput vexpr res substring
'bananarama' 1 -3
2042 echo $?
/$^ERRNAME
:$res:
2043 vput vexpr res substring
'bananarama' 3 -3
2044 echo $?
/$^ERRNAME
:$res:
2045 vput vexpr res substring
'bananarama' 5 -3
2046 echo $?
/$^ERRNAME
:$res:
2047 vput vexpr res substring
'bananarama' 7 -3
2048 echo $?
/$^ERRNAME
:$res:
2049 vput vexpr res substring
'bananarama' 9 -3
2050 echo $?
/$^ERRNAME
:$res:
2051 vput vexpr res substring
'bananarama' 10 -3
2052 echo $?
/$^ERRNAME
:$res:
2054 vput vexpr res trim
'Cocoon Cocoon'
2055 echo $?
/$^ERRNAME
:$res:
2056 vput vexpr res trim
' Cocoon Cocoon '
2057 echo $?
/$^ERRNAME
:$res:
2058 vput vexpr res trim-front
'Cocoon Cocoon'
2059 echo $?
/$^ERRNAME
:$res:
2060 vput vexpr res trim-front
' Cocoon Cocoon '
2061 echo $?
/$^ERRNAME
:$res:
2062 vput vexpr res trim-end
'Cocoon Cocoon'
2063 echo $?
/$^ERRNAME
:$res:
2064 vput vexpr res trim-end
' Cocoon Cocoon '
2065 echo $?
/$^ERRNAME
:$res:
2068 check behave
:vexpr-string
0 "${MBOX}" '3182004322 601'
2070 if have_feat regex
; then
2071 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
2072 vput vexpr res regex 'bananarama' 'nana'
2073 echo $?/$^ERRNAME :$res:
2074 vput vexpr res regex 'bananarama' 'bana'
2075 echo $?/$^ERRNAME :$res:
2076 vput vexpr res regex 'bananarama' 'Bana'
2077 echo $?/$^ERRNAME :$res:
2078 vput vexpr res regex 'bananarama' 'rama'
2079 echo $?/$^ERRNAME :$res:
2081 vput vexpr res iregex 'bananarama' 'nana'
2082 echo $?/$^ERRNAME :$res:
2083 vput vexpr res iregex 'bananarama' 'bana'
2084 echo $?/$^ERRNAME :$res:
2085 vput vexpr res iregex 'bananarama' 'Bana'
2086 echo $?/$^ERRNAME :$res:
2087 vput vexpr res iregex 'bananarama' 'rama'
2088 echo $?/$^ERRNAME :$res:
2090 vput vexpr res regex 'bananarama' '(.*)nana(.*)' '\${1}a\${0}u{\$2}'
2091 echo $?/$^ERRNAME :$res:
2092 vput vexpr res regex 'bananarama' '(.*)bana(.*)' '\${1}a\${0}u\$2'
2093 echo $?/$^ERRNAME :$res:
2094 vput vexpr res regex 'bananarama' 'Bana(.+)' '\$1\$0'
2095 echo $?/$^ERRNAME :$res:
2096 vput vexpr res regex 'bananarama' '(.+)rama' '\$1\$0'
2097 echo $?/$^ERRNAME :$res:
2099 vput vexpr res iregex 'bananarama' '(.*)nana(.*)' '\${1}a\${0}u{\$2}'
2100 echo $?/$^ERRNAME :$res:
2101 vput vexpr res iregex 'bananarama' '(.*)bana(.*)' '\${1}a\${0}u\$2'
2102 echo $?/$^ERRNAME :$res:
2103 vput vexpr res iregex 'bananarama' 'Bana(.+)' '\$1\$0'
2104 echo $?/$^ERRNAME :$res:
2105 vput vexpr res iregex 'bananarama' '(.+)rama' '\$1\$0'
2106 echo $?/$^ERRNAME :$res:
2110 check behave:vexpr-regex 0 "${MBOX}" '3270360157 311'
2112 printf 'behave:vexpr-regex: unsupported, skipped\n'
2118 t_behave_call_ret() {
2119 t_prolog t_behave_call_ret
2121 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Snomemdebug > "${MBOX}" 2>&1
2126 vput vexpr j
'&' $i 7
2132 vput vexpr j
'&' $i 7
2138 echo ! The end
for $1
2142 # Transport $?/$! up the call chain
2148 wysh
set i
=$? j
=$
! k
=$^ERRNAME
2152 echo ! The end
for $1
2153 return $i $^ERR-BUSY
2157 # Up and down it goes
2164 vput vexpr k
- $1 $2
2168 echo "# <$i/$j> .. "
2172 eval echon
"<\$1=\$i/\$^ERRNAME-$j "
2175 echo ! The end
for $1=$i/$2
2179 return $i $^ERR-BUSY
2185 call w1
0; echo ?
=$?
!=$
!; echo -----;
2186 call w2
0; echo ?
=$?
!=$^ERRNAME
; echo -----;
2187 call w3
0 1; echo ?
=$?
!=$^ERRNAME
; echo -----;
2190 check behave
:call_ret
0 "${MBOX}" '1572045517 5922'
2196 t_prolog t_behave_xcall
2198 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Snomemdebug > "${MBOX}" 2>&1
2203 vput vexpr j '&' $i 7
2209 echo ! The end for $1/$2
2211 return $i $^ERR-BUSY
2222 echo ?=$? !=$^ERRNAME
2225 echo ?=$? !=$^ERRNAME
2227 echo ?=$? !=$^ERRNAME
2230 check behave:xcall-1 0 "${MBOX}" '2401702082 23801'
2234 if have_feat uistrings; then
2235 ${cat} <<- '__EOT' > "${BODY}"
2240 vput vexpr j '&' $i 7
2246 echo ! The end for $1
2249 echo would be err with errexit
2258 echo zwei, ?=$? !=$!
2259 localopts yes; set errexit
2261 echo drei, ?=$? !=$^ERRNAME
2263 echo vier, ?=$? !=$^ERRNAME, this is an error
2266 echo outer 1, ?=$? !=$^ERRNAME
2268 echo outer 2, ?=$? !=$^ERRNAME, could be error if xxxign non-empty
2270 echo outer 3, ?=$? !=$^ERRNAME
2271 echo this is definitely an error
2274 < "${BODY}" ${MAILX} ${ARGS} -X'commandalias xxxign ignerr' \
2275 -Snomemdebug > "${MBOX}" 2>&1
2276 check behave
:xcall-2
0 "${MBOX}" '3900716531 4200'
2278 < "${BODY}" ${MAILX} ${ARGS} -X'commandalias xxxign " "' \
2279 -Snomemdebug > "${MBOX}" 2>&1
2280 check behave:xcall-3 1 "${MBOX}" '1006776201 2799'
2282 echo 'behave:xcall-2: unsupported, skipped'
2283 echo 'behave:xcall-3: unsupported, skipped'
2289 t_behave_vpospar() {
2290 t_prolog t_behave_vpospar
2292 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
2293 vpospar
set hey
, "'you ", world
!
2294 echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2295 vput vpospar x quote
; echo x
<$x>
2296 vpospar
clear;echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2297 vput vpospar y quote
;echo y
<$y>
2298 eval vpospar
set ${x};echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2299 eval vpospar
set ${y};echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2300 eval vpospar
set ${x};echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2303 echo infun2
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2304 vput vpospar z quote
;echo infun2
:z
<$z>
2308 echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2309 vput vpospar y quote
;echo infun
:y
<$y>
2310 eval vpospar
set ${x};echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2311 vpospar
clear;echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2313 echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2314 eval vpospar
set ${y};echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2317 call infun This
"in a" fun
2318 echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2319 vpospar
clear;echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2321 check behave
:vpospar-1
0 "${MBOX}" '155175639 866'
2324 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
2326 echo ifs<$ifs> ifs-ws<$ifs-ws>
2327 vpospar set hey, "'you ", world!
2328 echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2329 vput vpospar x quote; echo x<$x>
2330 vpospar clear;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2331 eval vpospar set ${x};echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2334 echo ifs<$ifs> ifs-ws<$ifs-ws>
2335 vpospar set hey, "'you
", world!
2336 unset ifs;echo $?/$^ERRNAME/$#: $* / "$@
" / <$1><$2><$3><$4>
2338 vput vpospar x quote; echo x<$x>
2339 vpospar clear;echo $?/$^ERRNAME/$#: $* / "$@
" / <$1><$2><$3><$4>
2340 eval vpospar set ${x};\
2341 unset ifs;echo $?/$^ERRNAME/$#: $* / "$@
" / <$1><$2><$3><$4>
2344 echo ifs<$ifs> ifs-ws<$ifs-ws>
2345 vpospar set hey, "'you ", world!
2346 unset ifs; echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2348 vput vpospar x quote; echo x<$x>
2349 vpospar clear;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2350 eval vpospar set ${x};\
2351 unset ifs;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2353 check behave:vpospar-ifs 0 "${MBOX}" '2015927702 706'
2358 t_behave_atxplode() {
2359 t_prolog t_behave_atxplode
2360 TRAP_EXIT_ADDONS="./.t*"
2362 ${cat} > ./.t.sh <<- '___
'; ${cat} > ./.t.rc <<- '___
'
2365 printf " (1/$#: <$1>)"
2367 if [ $# -gt 0 ]; then
2381 printf yyy;yyy 'xxx' "b\$
'\t'u
' "
2382 printf xxx;xxx arg ,b u.
2383 printf xxx;xxx arg , .
2384 printf xxx;xxx arg ,ball.
2390 echon " (1/$#: <$1>)"
2405 echon yyy;call yyy '\call xxx' "b\$
'\t'u
' "
2406 echon xxx;call xxx arg ,b u.
2407 echon xxx;call xxx arg , .
2408 echon xxx;call xxx arg ,ball.
2411 ${MAILX} ${ARGS} -X'source ./.t.rc' -Xx > "${MBOX}" 2>&1
2412 check behave:atxplode-1 0 "${MBOX}" '41566293 164'
2414 #${SHELL} ./.t.sh > ./.tshout 2>&1
2415 #check behave:atxplode:disproof-1 0 ./.tshout '41566293 164'
2421 t_prolog t_behave_read
2422 TRAP_EXIT_ADDONS="./.t*"
2424 ${cat} <<- '__EOT
' > .tin
2425 hey1, "'you
", world!
2426 hey2, "'you ", bugs bunny!
2431 ${cat} <<- '__EOT
' |\
2432 ${MAILX} ${ARGS} -X'readctl create ./.tin' > "${MBOX}" 2>&1
2434 echo $?/$^ERRNAME / <$a><$b><$c>
2436 echo $?/$^ERRNAME / <$a><$b><$c>
2438 echo $?/$^ERRNAME / <$a><$b><$c>
2440 echo $?/$^ERRNAME / <$a><$b><$c>
2441 unset a b c;read a b c
2442 echo $?/$^ERRNAME / <$a><$b><$c>
2443 readctl remove ./.tin;echo readctl remove:$?/$^ERRNAME
2445 check behave:read-1 0 "${MBOX}" '1527910147 173'
2447 ${cat} <<- '__EOT
' > .tin2
2448 hey2.0,:"'you
",:world!:mars.:
2449 hey2.1,:"'you ",:world!
2450 hey2.2,:"'you
",:bugs bunny!
2456 ${cat} <<- '__EOT' |\
2457 6< .tin2 ${MAILX} ${ARGS} -X 'readctl create 6' > "${MBOX}" 2>&1
2460 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2462 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2464 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2466 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2468 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2470 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2471 unset a b c
;read a b c
2472 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2474 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2475 readctl remove
6;echo readctl remove
:$?
/$^ERRNAME
2477 check behave
:read-ifs
0 "${MBOX}" '890153490 298'
2479 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
2481 readall d; echo $?/$^ERRNAME / <$d>
2482 wysh set d;readall d;echo $?/$^ERRNAME / <$d>
2483 readctl create .tin2
2484 readall d; echo $?/$^ERRNAME / <$d>
2485 wysh set d;readall d;echo $?/$^ERRNAME / <$d>
2486 readctl remove .tin;echo $?/$^ERRNAME;\
2487 readctl remove .tin2;echo $?/$^ERRNAME
2488 echo '### now with empty lines'
2489 ! printf 'one line\n\ntwo line\n\n' > ./.temptynl
2490 readctl create .temptynl;echo $?/$^ERRNAME
2491 readall d; echo "$?
/$^ERRNAME
/ <$d>"
2492 readctl remove .temptynl;echo $?/$^ERRNAME
2494 check readall 0 "${MBOX}" '4113506527 405'
2500 t_prolog t_behave_mbox
2501 TRAP_EXIT_ADDONS=".
/.t
*"
2505 while [ ${i} -lt 113 ]; do
2506 printf 'm file://%s\n~s Subject %s\nHello %s!\n~.\n' \
2507 "${MBOX}" "${i}" "${i}"
2510 ) | ${MAILX} ${ARGS} > .tall 2>&1
2511 check behave:mbox-1 0 "${MBOX}" '1872102723 13784'
2512 check behave:mbox-1-outerr - ./.tall '4294967295 0' # empty file
2514 printf 'File "%s
"\ncopy * "%s
"\nFile "%s
"\nfrom*' "${MBOX}" .tmbox1 .tmbox1 |
2515 ${MAILX} ${ARGS} -Sshowlast > .tall 2>&1
2516 check behave:mbox-2 0 .tall '3498373999 9103'
2518 printf 'File "%s
"\ncopy * "file://%s
"\nFile "file://%s
"\nfrom*' \
2519 "${MBOX}" .tmbox2 .tmbox2 | ${MAILX} ${ARGS} -Sshowlast > .tall
2>&1
2520 check behave
:mbox-3
0 .tall
'381610797 9110'
2522 # copy only the odd (but the first), move the even
2524 printf 'File "file://%s"\ncopy ' .tmbox2
2526 while [ ${i} -lt 113 ]; do
2530 printf 'file://%s\nFile "file://%s"\nfrom*' .tmbox3 .tmbox3
2531 ) |
${MAILX} ${ARGS} -Sshowlast > .tall
2>&1
2532 check behave
:mbox-4
0 .tmbox3
'4145104131 6890'
2533 check behave
:mbox-5
- .tall
'361127721 4573'
2536 printf 'file "file://%s"\nmove ' .tmbox2
2538 while [ ${i} -lt 113 ]; do
2542 printf 'file://%s\nFile "file://%s"\nfrom*\nFile "file://%s"\nfrom*' \
2543 .tmbox3 .tmbox3 .tmbox2
2544 ) |
${MAILX} ${ARGS} -Sshowlast > .tall 2>>${ERR}
2545 check behave
:mbox-6
0 .tmbox3
'3249991493 13784'
2546 if have_feat uistrings
; then
2547 ${sed} 2d
< .tall
> .tallx
2551 check behave
:mbox-7
- .tallx
'1584413080 13645'
2553 # Invalid MBOXes (after [f4db93b3])
2555 printf 'copy 1 ./.tinvmbox' |
${MAILX} ${ARGS} -Rf "${MBOX}" > .tall 2>&1
2556 check behave:mbox-8 0 .tinvmbox '896415941 122'
2557 check behave:mbox-9 - ./.tall '3146754194 33'
2559 echo ' ' > .tinvmbox
2560 printf 'copy 1 ./.tinvmbox' | ${MAILX} ${ARGS} -Rf "${MBOX}" > .tall
2>&1
2561 check behave
:mbox-10
0 .tinvmbox
'4011310616 124'
2562 check behave
:mbox-11
- .
/.tall
'3146754194 33'
2564 { echo; echo; } > .tinvmbox
# (not invalid)
2565 printf 'copy 1 ./.tinvmbox' |
${MAILX} ${ARGS} -Rf "${MBOX}" > .tall 2>&1
2566 check behave:mbox-12 0 .tinvmbox '287409579 123'
2567 check behave:mbox-13 - ./.tall '3146754194 33'
2569 # *mbox-rfc4155*, plus
2570 ${cat} <<-_EOT > ./.tinv1
2573 From MAILER-DAEMON-1 Wed Oct 2 01:50:07 1996
2574 Date: Wed, 02 Oct 1996 01:50:07 +0000
2576 Subject: Bad bad message 1
2578 From me to you, blinde Kuh!
2580 From MAILER-DAEMON-2 Wed Oct 2 01:50:07 1996
2581 Date: Wed, 02 Oct 1996 01:50:07 +0000
2583 Subject: Bad bad message 2
2585 From me to you, blindes Kalb!
2587 ${cp} ./.tinv1 ./.tinv2
2591 \\localopts yes; \\wysh set mbox-rfc4155;\\wysh File "${1}";\\
2592 \\eval copy * "${2}"
2594 call mboxfix ./.tinv1 ./.tok' | ${MAILX} ${ARGS} > .tall 2>&1
2595 ex0_test behave:mbox-14-estat
2596 ${cat} ./.tinv1 ./.tok >> .tall
2597 check behave:mbox-14 - ./.tall '739301109 616'
2600 'wysh file ./.tinv1 # ^From not repaired, but missing trailing NL is
2601 wysh File ./.tok # Just move away to nowhere
2603 wysh file ./.tinv2 # Fully repaired
2604 File ./.tok' | ${MAILX} ${ARGS} >>${ERR} 2>&1
2605 ex0_test behave:mbox-15-estat
2606 check behave:mbox-15-1 - ./.tinv1 '3178048820 332'
2607 check behave:mbox-15-2 - ./.tinv2 '4151504442 314'
2612 t_behave_maildir() {
2613 t_prolog t_behave_maildir
2614 TRAP_EXIT_ADDONS=".
/.t
*"
2618 while [ ${i} -lt 112 ]; do
2619 printf 'm file://%s\n~s Subject %s\nHello %s!\n~.\n' \
2620 "${MBOX}" "${i}" "${i}"
2623 ) | ${MAILX} ${ARGS}
2624 check behave:maildir-1 0 "${MBOX}" '1140119864 13780'
2630 ' "${MBOX}" .tmdir1 .tmdir1 |
2631 ${MAILX} ${ARGS} -Snewfolders=maildir -Sshowlast > .tlst
2632 check behave:maildir-2 0 .tlst '1797938753 9103'
2635 copy * "maildir
://%s
"
2638 ' "${MBOX}" .tmdir2 .tmdir2 |
2639 ${MAILX} ${ARGS} -Sshowlast > .tlst
2640 check behave:maildir-3 0 .tlst '1155631089 9113'
2642 printf 'File "maildir
://%s
"
2646 ' .tmdir2 .tmbox1 .tmbox1 |
2647 ${MAILX} ${ARGS} -Sshowlast > .tlst
2648 check behave:maildir-4 0 .tmbox1 '2646131190 13220'
2649 check behave:maildir-5 - .tlst '3701297796 9110'
2651 # only the odd (even)
2653 printf 'File "maildir
://%s
"
2656 while [ ${i} -lt 112 ]; do
2658 [ ${j} -eq 1 ] && printf '%s ' "${i}"
2665 ) | ${MAILX} ${ARGS} -Sshowlast > .tlst
2666 check behave:maildir-6 0 .tmbox2 '142890131 6610'
2667 check behave:maildir-7 - .tlst '960096773 4573'
2670 printf 'file "maildir
://%s
"
2673 while [ ${i} -lt 112 ]; do
2675 [ ${j} -eq 0 ] && [ ${i} -ne 0 ] && printf '%s ' "${i}"
2683 ' .tmbox2 .tmbox2 .tmdir2
2684 ) |
${MAILX} ${ARGS} -Sshowlast > .tlst
2685 check behave
:maildir-8
0 .tmbox2
'3806905791 13100'
2686 ${sed} 2d
< .tlst
> .tlstx
2687 check behave
:maildir-9
- .tlstx
'4216815295 13645'
2692 t_behave_record_a_resend
() {
2693 t_prolog t_behave_record_a_resend
2694 TRAP_EXIT_ADDONS
="./.t.record ./.t.resent"
2698 m %s\n~s Subject 1.\nHello.\n~.
2699 set record-files add-file-recipients
2700 m %s\n~s Subject 2.\nHello.\n~.
2702 resend 2 ./.t.resent
2703 Resend 1 ./.t.resent
2705 resend 2 ./.t.resent
2706 Resend 1 ./.t.resent
2707 ' .
/.t.record
"${MBOX}" "${MBOX}" "${MBOX}" |
2710 check behave
:record_a_resend-1
0 "${MBOX}" '3057873538 256'
2711 check behave
:record_a_resend-2
- .t.record
'391356429 460'
2712 check behave
:record_a_resend-3
- .t.resent
'2685231691 648'
2717 t_behave_e_H_L_opts
() {
2718 t_prolog t_behave_e_H_L_opts
2719 TRAP_EXIT_ADDONS
="./.tmta.sh ./.t.mbox"
2721 t_xmta
'Alchemilla Wed Apr 07 17:03:33 2017' .
/.t.mbox
2724 ${MAILX} ${ARGS} -ef .
/.t.mbox
2725 echo ${?} > "${MBOX}"
2727 printf 'm me@exam.ple\nLine 1.\nHello.\n~.\n' |
2728 ${MAILX} ${ARGS} -Smta=.
/.tmta.sh
2729 printf 'm you@exam.ple\nLine 1.\nBye.\n~.\n' |
2730 ${MAILX} ${ARGS} -Smta=.
/.tmta.sh
2732 ${MAILX} ${ARGS} -ef .
/.t.mbox
2733 echo ${?} >> "${MBOX}"
2734 ${MAILX} ${ARGS} -efL @t@me .
/.t.mbox
2735 echo ${?} >> "${MBOX}"
2736 ${MAILX} ${ARGS} -efL @t@you .
/.t.mbox
2737 echo ${?} >> "${MBOX}"
2738 ${MAILX} ${ARGS} -efL '@>@Line 1' .
/.t.mbox
2739 echo ${?} >> "${MBOX}"
2740 ${MAILX} ${ARGS} -efL '@>@Hello.' .
/.t.mbox
2741 echo ${?} >> "${MBOX}"
2742 ${MAILX} ${ARGS} -efL '@>@Bye.' .
/.t.mbox
2743 echo ${?} >> "${MBOX}"
2744 ${MAILX} ${ARGS} -efL '@>@Good bye.' .
/.t.mbox
2745 echo ${?} >> "${MBOX}"
2747 ${MAILX} ${ARGS} -fH ./.t.mbox >> "${MBOX}"
2748 echo ${?} >> "${MBOX}"
2749 ${MAILX} ${ARGS} -fL @t@me ./.t.mbox >> "${MBOX}"
2750 echo ${?} >> "${MBOX}"
2751 ${MAILX} ${ARGS} -fL @t@you ./.t.mbox >> "${MBOX}"
2752 echo ${?} >> "${MBOX}"
2753 ${MAILX} ${ARGS} -fL '@>@Line 1' ./.t.mbox >> "${MBOX}"
2754 echo ${?} >> "${MBOX}"
2755 ${MAILX} ${ARGS} -fL '@>@Hello.' ./.t.mbox >> "${MBOX}"
2756 echo ${?} >> "${MBOX}"
2757 ${MAILX} ${ARGS} -fL '@>@Bye.' ./.t.mbox >> "${MBOX}"
2758 echo ${?} >> "${MBOX}"
2759 ${MAILX} ${ARGS} -fL '@>@Good bye.' ./.t.mbox >> "${MBOX}" 2>>${ERR}
2760 echo ${?} >> "${MBOX}"
2762 check behave
:e_H_L_opts
- "${MBOX}" '1708955574 678'
2767 t_behave_alternates
() {
2768 t_prolog t_behave_alternates
2769 TRAP_EXIT_ADDONS
="./.t*"
2771 t_xmta
'Valeriana Sat Jul 08 15:54:03 2017'
2773 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Smta=.
/.tmta.sh
> .
/.tall
2>&1
2777 alternates a1@b1 a2@b2 a3@b3
2782 echo $?
/$^ERRNAME
<$rv>
2787 echo $?
/$^ERRNAME
<$rv>
2790 echo $?
/$^ERRNAME
<$rv>
2793 echo $?
/$^ERRNAME
<$rv>
2797 alternates a1@b1 a2@b2 a3@b3
2800 echo $?
/$^ERRNAME
<$rv>
2803 echo $?
/$^ERRNAME
<$rv>
2806 echo $?
/$^ERRNAME
<$rv>
2809 alternates a1@b1 a2@b2 a3@b3
2812 echo $?
/$^ERRNAME
<$rv>
2815 echo $?
/$^ERRNAME
<$rv>
2818 echo $?
/$^ERRNAME
<$rv>
2822 alternates a1@b1 a2@b2 a3@b3
2825 echo $?
/$^ERRNAME
<$rv>
2829 alternates a1@b1 a1@c1 a1@d1 a2@b2 a3@b3 a3@c3 a3@d3
2831 ~s all alternates
, only a1@b1 remains
2833 ~b a3@b3 a3@c3 a3@d3
2842 alternates a1@b1 a1@c1 a2@b2 a3@b3
2844 ~s a1@b1 a1@d1
, and a3@c3 a3@d3 remain
2846 ~b a3@b3 a3@c3 a3@d3
2853 alternates a1@b1 a2@b2 a3
; set allnet
2855 ~s all alternates via allnet
, only a1@b1 remains
2857 ~b a3@b3 a3@c3 a3@d3
2868 echo $?
/$^ERRNAME
<$rv>
2872 echo $?
/$^ERRNAME
<$rv>
2876 echo $?
/$^ERRNAME
<$rv>
2880 echo $?
/$^ERRNAME
<$rv>
2884 echo $?
/$^ERRNAME
<$rv>
2888 alternates a1@b1 a2@b2
2891 echo $?
/$^ERRNAME
<$rv>
2892 alternates a3@b3 a4@b4
2895 echo $?
/$^ERRNAME
<$rv>
2898 check behave
:alternates-1
0 "${MBOX}" '142184864 515'
2899 if have_feat uistrings
; then
2900 check behave
:alternates-2
- .tall
'1878598364 505'
2902 echo 'behave:alternates-2: unsupported, skipped'
2909 t_prolog t_behave_alias
2910 TRAP_EXIT_ADDONS
="./.t*"
2912 t_xmta
'Hippocastanum Mon Jun 19 15:07:07 2017'
2914 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Smta=.
/.tmta.sh
> .
/.tall
2>&1
2916 alias a1 ex2@a1.ple
"EX3 <ex3@a1.ple>"
2918 alias a2 ex1@a2.ple ex2@a2.ple ex3@a2.ple ex4@a2.ple
2920 alias a4 a5 ex1@a4.ple
2922 alias a6 a7 ex1@a6.ple
2936 check behave
:alias-1
0 "${MBOX}" '2496925843 272'
2937 check behave
:alias-2
- .tall
'3548953204 152'
2939 # TODO t_behave_alias: n_ALIAS_MAXEXP is compile-time constant,
2940 # TODO need to somehow provide its contents to the test, then test
2945 t_behave_filetype
() {
2946 t_prolog t_behave_filetype
2947 TRAP_EXIT_ADDONS
="./.t*"
2949 t_xmta
'Alchemilla Wed Apr 25 15:12:13 2017'
2951 printf 'm m1@e.t\nL1\nHy1\n~.\nm m2@e.t\nL2\nHy2\n~@ %s\n~.\n' \
2952 "${SRCDIR}snailmail.jpg" | ${MAILX} ${ARGS} -Smta=./.tmta.sh
2953 check behave:filetype-1 0 "${MBOX}" '1594682963 13520'
2955 if (echo | gzip -c) >/dev/null 2>&1; then
2957 printf 'File "%s
"\ncopy 1 ./.t.mbox.gz\ncopy 2 ./.t.mbox.gz' \
2958 "${MBOX}" | ${MAILX} ${ARGS} \
2959 -X'filetype gz gzip\ -dc gzip\ -c'
2960 printf 'File ./.t.mbox.gz\ncopy * ./.t.mbox\n' |
2961 ${MAILX} ${ARGS} -X'filetype gz gzip\ -dc gzip\ -c'
2963 check behave
:filetype-2
- "./.t.mbox" '1594682963 13520'
2964 check behave
:filetype-3
- "./.t.out" '2392348396 102'
2966 echo 'behave:filetype-2: unsupported, skipped'
2967 echo 'behave:filetype-3: unsupported, skipped'
2972 printf 'File "%s"\ncopy 1 ./.t.mbox.gz
2978 -X'filetype gz gzip\ -dc gzip\ -c' \
2979 -X'filetype mbox.gz "${sed} 1,3d|${cat}" \
2980 "echo eins;echo zwei;echo und mit ${sed} bist Du dabei;${cat}"'
2981 printf 'File ./.t.mbox.gz\ncopy * ./.t.mbox\n' |
2983 -X'filetype gz gzip\ -dc gzip\ -c' \
2984 -X'filetype mbox.gz "${sed} 1,3d|${cat}" kill\ 0'
2986 check behave
:filetype-4
- "./.t.mbox" '2886541147 27060'
2987 check behave
:filetype-5
- "./.t.out" '852335377 172'
2992 t_behave_message_injections
() {
2993 t_prolog t_behave_message_injections
2994 TRAP_EXIT_ADDONS
="./.t*"
2996 t_xmta
'Echinacea Tue Jun 20 15:54:02 2017'
2998 echo mysig
> .
/.tmysig
3000 echo some-body |
${MAILX} ${ARGS} -Smta=.
/.tmta.sh \
3001 -Smessage-inject-head=head-inject \
3002 -Smessage-inject-tail=tail-inject \
3003 -Ssignature=.
/.tmysig \
3004 ex@am.ple
> .
/.tall
2>&1
3005 check behave
:message_injections-1
0 "${MBOX}" '2434746382 134'
3006 check behave
:message_injections-2
- .tall
'4294967295 0' # empty file
3009 ${cat} <<-_EOT > ./.template
3013 Subject: This subject is
3015 Body, body, body me.
3017 < .
/.template
${MAILX} ${ARGS} -t -Smta=.
/.tmta.sh \
3018 -Smessage-inject-head=head-inject \
3019 -Smessage-inject-tail=tail-inject \
3020 -Ssignature=.
/.tmysig \
3022 check behave
:message_injections-3
0 "${MBOX}" '3114203412 198'
3023 check behave
:message_injections-4
- .tall
'4294967295 0' # empty file
3028 t_behave_attachments
() {
3029 t_prolog t_behave_attachments
3030 TRAP_EXIT_ADDONS
="./.t*"
3032 t_xmta
'Cannabis Sun Feb 18 02:02:46 2018'
3034 ${cat} <<-_EOT > ./.tx
3035 From steffen Sun Feb 18 02:48:40 2018
3036 Date: Sun, 18 Feb 2018 02:48:40 +0100
3039 User-Agent: s-nail v14.9.7
3042 From steffen Sun Feb 18 02:48:42 2018
3043 Date: Sun, 18 Feb 2018 02:48:42 +0100
3046 User-Agent: s-nail v14.9.7
3051 printf 'att2-1\natt2-2\natt2-4\n' > .
/'.t 2'
3052 printf 'att3-1\natt3-2\natt3-4\n' > .
/.t3
3053 printf 'att4-1\natt4-2\natt4-4\n' > './.t 4'
3056 '!@ ./.t3 "./.t 4" ""
3064 |
${MAILX} ${ARGS} -Sescape=! -Smta=.
/.tmta.sh \
3065 -a .
/.t1
-a './.t 2' \
3066 -s attachment-test \
3067 ex@am.ple
> .
/.tall
2>&1
3068 check behave
:attachments-1
0 "${MBOX}" '4107062253 634'
3069 if have_feat uistrings
; then
3070 check behave
:attachments-2
- .tall
'1928331872 720'
3072 echo 'behave:attachments-2: unsupported, skipped'
3078 !s This the subject is
3079 !@ ./.t3 "#2" "./.t 4" "#1" ""
3089 !@ ./.t3 "#2" "./.t 4" "#1" ""
3097 !@ ./.t3 "" "#2" "" "./.t 4" "" "#1" ""
3106 !@ ./.t3 "" "#2" "" "./.t 4" "" "#1" ""
3120 |
${MAILX} ${ARGS} -Sescape=! -Smta=.
/.tmta.sh
-Rf .
/.tx \
3122 check behave
:attachments-3
0 "${MBOX}" '798122412 2285'
3123 if have_feat uistrings
; then
3124 check behave
:attachments-4
- .tall
'2526106274 1910'
3126 echo 'behave:attachments-4: unsupported, skipped'
3132 t_behave_compose_hooks
() { # TODO monster
3133 t_prolog t_behave_compose_hooks
3134 if have_feat uistrings
; then :; else
3135 echo 'behave:compose_hooks: unsupported, skipped'
3138 TRAP_EXIT_ADDONS
="./.t*"
3140 t_xmta
'PrimulaVeris Wed Apr 10 22:59:00 2017'
3142 (echo line one
&&echo line two
&&echo line three
) > .
/.treadctl
3143 (echo echo four
&&echo echo five
&&echo echo six
) > .
/.tattach
3145 ${cat} <<'__EOT__' > ./.trc
3147 echoerr "Failed: $1. Bailing out"; echo "~x"; xit
3150 vput vexpr es substr "$1" 0 1
3155 define read_mline_res {
3156 read hl; wysh set len=$? es=$! en=$^ERRNAME;\
3157 echo $len/$es/$^ERRNAME: $hl
3158 if [ $es -ne $^ERR-NONE ]
3159 xcall bail read_mline_res
3161 \xcall read_mline_res
3166 echo "~^header list"; read hl; echo $hl;\
3167 call xerr "$hl" "in_addr ($xh) 0-1"
3169 echo "~^header insert $xh diet <$xh@exam.ple> spliced";\
3170 read es; echo $es; call xerr "$es" "ins_addr $xh 1-1"
3171 echo "~^header insert $xh <${xh}2@exam.ple>";\
3172 read es; echo $es; call xerr "$es" "ins_addr $xh 1-2"
3173 echo "~^header insert $xh ${xh}3@exam.ple";\
3174 read es; echo $es; call xerr "$es" "ins_addr $xh 1-3"
3175 echo "~^header list $xh"; read hl; echo $hl;\
3176 call xerr "$hl" "ins_addr $xh 1-4"
3177 echo "~^header show $xh"; read es; call xerr $es "ins_addr $xh 1-5"
3180 if [ "$t_remove" == "" ]
3184 echo "~^header remove $xh"; read es; call xerr $es "ins_addr $xh 2-1"
3185 echo "~^header remove $xh"; read es; vput vexpr es substr $es 0 3
3187 xcall bail "ins_addr $xh 2-2"
3189 echo "~^header list $xh"; read es; vput vexpr es substr $es 0 3
3191 xcall bail "ins_addr $xh 2-3"
3193 echo "~^header show $xh"; read es; vput vexpr es substr $es 0 3
3195 xcall bail "ins_addr $xh 2-4"
3199 echo "~^header insert $xh diet <$xh@exam.ple> spliced";\
3200 read es; echo $es; call xerr "$es" "ins_addr $xh 3-1"
3201 echo "~^header insert $xh <${xh}2@exam.ple>";\
3202 read es; echo $es; call xerr "$es" "ins_addr $xh 3-2"
3203 echo "~^header insert $xh ${xh}3@exam.ple";\
3204 read es; echo $es; call xerr "$es" "ins_addr $xh 3-3"
3205 echo "~^header list $xh"; read hl; echo $hl;\
3206 call xerr "$hl" "ins_addr $xh 3-4"
3207 echo "~^header show $xh"; read es; call xerr $es "ins_addr $xh 3-5"
3210 echo "~^header remove-at $xh 1"; read es;\
3211 call xerr $es "ins_addr $xh 3-6"
3212 echo "~^header remove-at $xh 1"; read es;\
3213 call xerr $es "ins_addr $xh 3-7"
3214 echo "~^header remove-at $xh 1"; read es;\
3215 call xerr $es "ins_addr $xh 3-8"
3216 echo "~^header remove-at $xh 1"; read es;\
3217 vput vexpr es substr $es 0 3
3219 xcall bail "ins_addr $xh 3-9"
3221 echo "~^header remove-at $xh T"; read es;\
3222 vput vexpr es substr $es 0 3
3224 xcall bail "ins_addr $xh 3-10"
3226 echo "~^header list $xh"; read es;\
3227 vput vexpr es substr $es 0 3
3229 xcall bail "ins_addr $xh 3-11"
3231 echo "~^header show $xh"; read es;\
3232 vput vexpr es substr $es 0 3
3234 xcall bail "ins_addr $xh 3-12"
3238 echo "~^header insert $xh diet <$xh@exam.ple> spliced";\
3239 read es; echo $es; call xerr "$es" "ins_addr $xh 4-1"
3240 echo "~^header insert $xh <${xh}2@exam.ple> (comment) \"Quot(e)d\"";\
3241 read es; echo $es; call xerr "$es" "ins_addr $xh 4-2"
3242 echo "~^header insert $xh ${xh}3@exam.ple";\
3243 read es; echo $es; call xerr "$es" "ins_addr $xh 4-3"
3244 echo "~^header list $xh"; read hl; echo $hl;\
3245 call xerr "$hl" "header list $xh 3-4"
3246 echo "~^header show $xh"; read es; call xerr $es "ins_addr $xh 4-5"
3249 echo "~^header remove-at $xh 3"; read es;\
3250 call xerr $es "ins_addr $xh 4-6"
3251 echo "~^header remove-at $xh 2"; read es;\
3252 call xerr $es "ins_addr $xh 4-7"
3253 echo "~^header remove-at $xh 1"; read es;\
3254 call xerr $es "ins_addr $xh 4-8"
3255 echo "~^header remove-at $xh 1"; read es;\
3256 vput vexpr es substr $es 0 3
3258 xcall bail "ins_addr $xh 4-9"
3260 echo "~^header remove-at $xh T"; read es;\
3261 vput vexpr es substr $es 0 3
3263 xcall bail "ins_addr $xh 4-10"
3265 echo "~^header list $xh"; read es;\
3266 vput vexpr es substr $es 0 3
3268 xcall bail "ins_addr $xh 4-11"
3270 echo "~^header show $xh"; read es;\
3271 vput vexpr es substr $es 0 3
3273 xcall bail "ins_addr $xh 4-12"
3277 wysh set xh=$1 mult=$2
3278 echo "~^header list"; read hl; echo $hl;\
3279 call xerr "$hl" "ins_ref ($xh) 0-1"
3281 echo "~^header insert $xh <$xh@exam.ple>";\
3282 read es; echo $es; call xerr "$es" "ins_ref $xh 1-1"
3284 echo "~^header insert $xh <${xh}2@exam.ple>";\
3285 read es; echo $es; call xerr "$es" "ins_ref $xh 1-2"
3286 echo "~^header insert $xh ${xh}3@exam.ple";\
3287 read es; echo $es; call xerr "$es" "ins_ref $xh 1-3"
3289 echo "~^header insert $xh <${xh}2@exam.ple>"; read es;\
3290 vput vexpr es substr $es 0 3
3292 xcall bail "ins_ref $xh 1-4"
3296 echo "~^header list $xh"; read hl; echo $hl;\
3297 call xerr "$hl" "ins_ref $xh 1-5"
3298 echo "~^header show $xh"; read es; call xerr $es "ins_ref $xh 1-6"
3301 if [ "$t_remove" == "" ]
3305 echo "~^header remove $xh"; read es;\
3306 call xerr $es "ins_ref $xh 2-1"
3307 echo "~^header remove $xh"; read es;\
3308 vput vexpr es substr $es 0 3
3310 xcall bail "ins_ref $xh 2-2"
3312 echo "~^header list $xh"; read es;\
3313 vput vexpr es substr $es 0 3
3315 xcall bail "$es ins_ref $xh 2-3"
3317 echo "~^header show $xh"; read es;\
3318 vput vexpr es substr $es 0 3
3320 xcall bail "ins_ref $xh 2-4"
3324 echo "~^header insert $xh <$xh@exam.ple>";\
3325 read es; echo $es; call xerr "$es" "ins_ref $xh 3-1"
3327 echo "~^header insert $xh <${xh}2@exam.ple>";\
3328 read es; echo $es; call xerr "$es" "ins_ref $xh 3-2"
3329 echo "~^header insert $xh ${xh}3@exam.ple";\
3330 read es; echo $es; call xerr "$es" "ins_ref $xh 3-3"
3332 echo "~^header list $xh";\
3333 read hl; echo $hl; call xerr "$hl" "ins_ref $xh 3-4"
3334 echo "~^header show $xh";\
3335 read es; call xerr $es "ins_ref $xh 3-5"
3338 echo "~^header remove-at $xh 1"; read es;\
3339 call xerr $es "ins_ref $xh 3-6"
3340 if [ $mult -ne 0 ] && [ $xh != subject ]
3341 echo "~^header remove-at $xh 1"; read es;\
3342 call xerr $es "ins_ref $xh 3-7"
3343 echo "~^header remove-at $xh 1"; read es;\
3344 call xerr $es "ins_ref $xh 3-8"
3346 echo "~^header remove-at $xh 1"; read es;\
3347 vput vexpr es substr $es 0 3
3349 xcall bail "ins_ref $xh 3-9"
3351 echo "~^header remove-at $xh T"; read es;\
3352 vput vexpr es substr $es 0 3
3354 xcall bail "ins_ref $xh 3-10"
3356 echo "~^header show $xh"; read es;\
3357 vput vexpr es substr $es 0 3
3359 xcall bail "ins_ref $xh 3-11"
3363 echo "~^header insert $xh <$xh@exam.ple> ";\
3364 read es; echo $es; call xerr "$es" "ins_ref $xh 4-1"
3366 echo "~^header insert $xh <${xh}2@exam.ple> ";\
3367 read es; echo $es; call xerr "$es" "ins_ref $xh 4-2"
3368 echo "~^header insert $xh ${xh}3@exam.ple";\
3369 read es; echo $es; call xerr "$es" "ins_ref $xh 4-3"
3371 echo "~^header list $xh"; read hl; echo $hl;\
3372 call xerr "$hl" "ins_ref $xh 4-4"
3373 echo "~^header show $xh"; read es; call xerr $es "ins_ref $xh 4-5"
3376 if [ $mult -ne 0 ] && [ $xh != subject ]
3377 echo "~^header remove-at $xh 3"; read es;\
3378 call xerr $es "ins_ref $xh 4-6"
3379 echo "~^header remove-at $xh 2"; read es;\
3380 call xerr $es "ins_ref $xh 4-7"
3382 echo "~^header remove-at $xh 1"; read es;\
3383 call xerr $es "ins_ref $xh 4-8"
3384 echo "~^header remove-at $xh 1"; read es;\
3385 vput vexpr es substr $es 0 3
3387 xcall bail "ins_ref $xh 4-9"
3389 echo "~^header remove-at $xh T"; read es;\
3390 vput vexpr es substr $es 0 3
3392 xcall bail "ins_ref $xh 4-10"
3394 echo "~^header show $xh"; read es;\
3395 vput vexpr es substr $es 0 3
3397 xcall bail "ins_ref $xh 4-11"
3402 # In collect.c order
3404 call ins_ref sender 0 # Not a "ref", but works
3408 call ins_addr reply-To
3409 call ins_addr mail-Followup-to
3410 call ins_ref messAge-id 0
3411 call ins_ref rEfErEncEs 1
3412 call ins_ref in-Reply-to 1
3413 call ins_ref subject 1 # Not a "ref", but works (with tweaks)
3414 call ins_addr freeForm1
3415 call ins_addr freeform2
3417 echo "~^header show MAILX-Command"; read es; call xerr $es "t_header 1000"
3419 echo "~^header show MAILX-raw-TO"; read es; call xerr $es "t_header 1001"
3427 echo "~^attachment";\
3428 read hl; echo $hl; vput vexpr es substr "$hl" 0 3
3430 xcall bail "attach 0-1"
3433 echo "~^attach attribute ./.treadctl";\
3434 read hl; echo $hl; vput vexpr es substr "$hl" 0 3
3436 xcall bail "attach 0-2"
3438 echo "~^attachment attribute-at 1";\
3439 read hl; echo $hl; vput vexpr es substr "$hl" 0 3
3441 xcall bail "attach 0-3"
3444 echo "~^attachment insert ./.treadctl=ascii";\
3445 read hl; echo $hl; call xerr "$hl" "attach 1-1"
3446 echo "~^attachment list";\
3447 read es; echo $es;call xerr "$es" "attach 1-2"
3449 echo "~^attachment attribute ./.treadctl";\
3450 read es; echo $es;call xerr "$es" "attach 1-3"
3452 echo "~^attachment attribute .treadctl";\
3453 read es; echo $es;call xerr "$es" "attach 1-4"
3455 echo "~^attachment attribute-at 1";\
3456 read es; echo $es;call xerr "$es" "attach 1-5"
3459 echo "~^attachment attribute-set ./.treadctl filename rctl";\
3460 read es; echo $es;call xerr "$es" "attach 1-6"
3461 echo "~^attachment attribute-set .treadctl content-description Au";\
3462 read es; echo $es;call xerr "$es" "attach 1-7"
3463 echo "~^attachment attribute-set-at 1 content-id <10.du@ich>";\
3464 read es; echo $es;call xerr "$es" "attach 1-8"
3466 echo "~^attachment attribute ./.treadctl";\
3467 read es; echo $es;call xerr "$es" "attach 1-9"
3469 echo "~^attachment attribute .treadctl";\
3470 read es; echo $es;call xerr "$es" "attach 1-10"
3472 echo "~^attachment attribute rctl";\
3473 read es; echo $es;call xerr "$es" "attach 1-11"
3475 echo "~^attachment attribute-at 1";\
3476 read es; echo $es;call xerr "$es" "attach 1-12"
3480 echo "~^attachment insert ./.tattach=latin1";\
3481 read hl; echo $hl; call xerr "$hl" "attach 2-1"
3482 echo "~^attachment list";\
3483 read es; echo $es;call xerr "$es" "attach 2-2"
3485 echo "~^attachment attribute ./.tattach";\
3486 read es; echo $es;call xerr "$es" "attach 2-3"
3488 echo "~^attachment attribute .tattach";\
3489 read es; echo $es;call xerr "$es" "attach 2-4"
3491 echo "~^attachment attribute-at 2";\
3492 read es; echo $es;call xerr "$es" "attach 2-5"
3495 echo "~^attachment attribute-set ./.tattach filename tat";\
3496 read es; echo $es;call xerr "$es" "attach 2-6"
3498 "~^attachment attribute-set .tattach content-description Au2";\
3499 read es; echo $es;call xerr "$es" "attach 2-7"
3500 echo "~^attachment attribute-set-at 2 content-id <20.du@wir>";\
3501 read es; echo $es;call xerr "$es" "attach 2-8"
3503 "~^attachment attribute-set-at 2 content-type application/x-sh";\
3504 read es; echo $es;call xerr "$es" "attach 2-9"
3506 echo "~^attachment attribute ./.tattach";\
3507 read es; echo $es;call xerr "$es" "attach 2-10"
3509 echo "~^attachment attribute .tattach";\
3510 read es; echo $es;call xerr "$es" "attach 2-11"
3512 echo "~^attachment attribute tat";\
3513 read es; echo $es;call xerr "$es" "attach 2-12"
3515 echo "~^attachment attribute-at 2";\
3516 read es; echo $es;call xerr "$es" "attach 2-13"
3520 if [ "$t_remove" == "" ]
3524 echo "~^attachment remove ./.treadctl"; read es;\
3525 call xerr $es "attach 3-1"
3526 echo "~^attachment remove ./.tattach"; read es;\
3527 call xerr $es "attach 3-2"
3528 echo "~^ attachment remove ./.treadctl"; read es;\
3529 vput vexpr es substr $es 0 3
3531 xcall bail "attach 3-3"
3533 echo "~^ attachment remove ./.tattach"; read es;\
3534 vput vexpr es substr $es 0 3
3536 xcall bail "attach 3-4"
3538 echo "~^attachment list"; read es;\
3539 vput vexpr es substr $es 0 3
3541 xcall bail "attach 3-5"
3545 echo "~^attachment insert ./.tattach=latin1";\
3546 read hl; echo $hl; call xerr "$hl" "attach 4-1"
3547 echo "~^attachment insert ./.tattach=latin1";\
3548 read hl; echo $hl; call xerr "$hl" "attach 4-2"
3549 echo "~^attachment list";\
3550 read es; echo $es;call xerr "$es" "attach 4-3"
3552 echo "~^ attachment remove .tattach"; read es;\
3553 vput vexpr es substr $es 0 3
3555 xcall bail "attach 4-4 $es"
3557 echo "~^attachment remove-at T"; read es;\
3558 vput vexpr es substr $es 0 3
3560 xcall bail "attach 4-5"
3562 echo "~^attachment remove ./.tattach"; read es;\
3563 call xerr $es "attach 4-6"
3564 echo "~^attachment remove ./.tattach"; read es;\
3565 call xerr $es "attach 4-7"
3566 echo "~^ attachment remove ./.tattach"; read es;\
3567 vput vexpr es substr $es 0 3
3569 xcall bail "attach 4-8 $es"
3571 echo "~^attachment list"; read es;\
3572 vput vexpr es substr $es 0 3
3574 xcall bail "attach 4-9"
3578 echo "~^attachment insert ./.tattach=latin1";\
3579 read hl; echo $hl; call xerr "$hl" "attach 5-1"
3580 echo "~^attachment insert ./.tattach=latin1";\
3581 read hl; echo $hl; call xerr "$hl" "attach 5-2"
3582 echo "~^attachment insert ./.tattach=latin1";\
3583 read hl; echo $hl; call xerr "$hl" "attach 5-3"
3584 echo "~^attachment list";\
3585 read es; echo $es;call xerr "$es" "attach 5-4"
3588 echo "~^attachment remove-at 3"; read es;\
3589 call xerr $es "attach 5-5"
3590 echo "~^attachment remove-at 3"; read es;\
3591 vput vexpr es substr $es 0 3
3593 xcall bail "attach 5-6"
3595 echo "~^attachment remove-at 2"; read es;\
3596 call xerr $es "attach 5-7"
3597 echo "~^attachment remove-at 2"; read es;\
3598 vput vexpr es substr $es 0 3
3600 xcall bail "attach 5-8"
3602 echo "~^attachment remove-at 1"; read es;\
3603 call xerr $es "attach 5-9"
3604 echo "~^attachment remove-at 1"; read es;\
3605 vput vexpr es substr $es 0 3
3607 xcall bail "attach 5-10"
3610 echo "~^attachment list"; read es;\
3611 vput vexpr es substr $es 0 3
3613 xcall bail "attach 5-11"
3617 echo "~^attachment insert ./.tattach=latin1";\
3618 read hl; echo $hl; call xerr "$hl" "attach 6-1"
3619 echo "~^attachment insert ./.tattach=latin1";\
3620 read hl; echo $hl; call xerr "$hl" "attach 6-2"
3621 echo "~^attachment insert ./.tattach=latin1";\
3622 read hl; echo $hl; call xerr "$hl" "attach 6-3"
3623 echo "~^attachment list";\
3624 read es; echo $es;call xerr "$es" "attach 6-4"
3627 echo "~^attachment remove-at 1"; read es;\
3628 call xerr $es "attach 6-5"
3629 echo "~^attachment remove-at 1"; read es;\
3630 call xerr $es "attach 6-6"
3631 echo "~^attachment remove-at 1"; read es;\
3632 call xerr $es "attach 6-7"
3633 echo "~^attachment remove-at 1"; read es;\
3634 vput vexpr es substr $es 0 3
3636 xcall bail "attach 6-8"
3639 echo "~^attachment list"; read es;\
3640 vput vexpr es substr $es 0 3
3642 xcall bail "attach 6-9"
3654 echo on-compose-enter, mailx-command<$mailx-command>
3655 alternates alter1@exam.ple alter2@exam.ple
3657 set autocc='alter1@exam.ple alter2@exam.ple'
3658 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3659 echo mailx-subject<$mailx-subject>
3660 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3661 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3662 mailx-raw-bcc<$mailx-raw-bcc>
3663 echo mailx-orig-from<$mailx-orig-from> mailx-orig-to<$mailx-orig-to> \
3664 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3667 echo on-compose-leave, mailx-command<$mailx-command>
3669 eval alternates $al alter3@exam.ple alter4@exam.ple
3671 set autobcc='alter3@exam.ple alter4@exam.ple'
3672 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3673 echo mailx-subject<$mailx-subject>
3674 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3675 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3676 mailx-raw-bcc<$mailx-raw-bcc>
3677 echo mailx-orig-from<$mailx-orig-from> mailx-orig-to<$mailx-orig-to> \
3678 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3681 echo on-compose-cleanup, mailx-command<$mailx-command>
3684 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3685 echo mailx-subject<$mailx-subject>
3686 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3687 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3688 mailx-raw-bcc<$mailx-raw-bcc>
3689 echo mailx-orig-from<$mailx-orig-from> mailx-orig-to<$mailx-orig-to> \
3690 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3692 wysh set on-compose-splice=t_ocs \
3693 on-compose-enter=t_oce on-compose-leave=t_ocl \
3694 on-compose-cleanup=t_occ
3697 printf 'm this-goes@nowhere\nbody\n!.\n' |
3698 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
3699 -X'source ./.trc' -Smta=.
/.tmta.sh \
3701 ${cat} .
/.tall
>> "${MBOX}"
3702 check behave
:compose_hooks-1
0 "${MBOX}" '522535560 10101'
3705 printf 'm this-goes@nowhere\nbody\n!.\n' |
3706 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
3707 -St_remove=1 -X'source ./.trc' -Smta=.
/.tmta.sh \
3709 ${cat} .
/.tall
>> "${MBOX}"
3710 check behave
:compose_hooks-2
0 "${MBOX}" '3654000499 12535'
3714 # Some state machine stress, shell compose hook, localopts for hook, etc.
3715 # readctl in child. ~r as HERE document
3717 printf 'm ex@am.ple\nbody\n!.
3718 echon ${mailx-command}${mailx-subject}
3719 echon ${mailx-from}${mailx-sender}
3720 echon ${mailx-to}${mailx-cc}${mailx-bcc}
3721 echon ${mailx-raw-to}${mailx-raw-cc}${mailx-raw-bcc}
3722 echon ${mailx-orig-from}${mailx-orig-to}${mailx-orig-gcc}${mailx-orig-bcc}
3723 var t_oce t_ocs t_ocs_sh t_ocl t_occ autocc
3724 ' |
${MAILX} ${ARGS} -Snomemdebug -Sescape=! \
3728 echoerr "Failed: $1. Bailing out"; echo "~x"; xit
3731 vput vexpr es substr "$1" 0 1
3736 define read_mline_res {
3737 read hl; wysh set len=$? es=$! en=$^ERRNAME;\
3738 echo $len/$es/$^ERRNAME: $hl
3739 if [ $es -ne $^ERR-NONE ]
3740 xcall bail read_mline_res
3742 \xcall read_mline_res
3746 vput vexpr i + 1 "$2"
3748 vput vexpr j % $i 10
3755 eval \\$j _work $1 $i
3758 vput vexpr i + $i "$1"
3762 wysh set line; read line;wysh set es=$? en=$^ERRNAME ;\
3763 echo read:$es/$en: $line
3764 if [ "${es}" -ne -1 ]
3767 readctl remove $cwd/.treadctl; echo readctl remove:$?/$^ERRNAME
3772 echo "~^header list"; read hl; echo $hl;\
3773 vput vexpr es substr "$hl" 0 1
3775 xcall bail "header list"
3778 call _work 1; echo $?
3779 echo "~^header insert cc splicy diet <splice@exam.ple> spliced";\
3780 read es; echo $es; vput vexpr es substr "$es" 0 1
3782 xcall bail "be diet"
3784 echo "~^header insert cc <splice2@exam.ple>";\
3785 read es; echo $es; vput vexpr es substr "$es" 0 1
3787 xcall bail "be diet2"
3790 call _work 2; echo $?
3791 echo "~^header insert bcc juicy juice <juice@exam.ple> spliced";\
3792 read es; echo $es;vput vexpr es substr "$es" 0 1
3794 xcall bail "be juicy"
3796 echo "~^header insert bcc juice2@exam.ple";\
3797 read es; echo $es;vput vexpr es substr "$es" 0 1
3799 xcall bail "be juicy2"
3801 echo "~^header insert bcc juice3 <juice3@exam.ple>";\
3802 read es; echo $es;vput vexpr es substr "$es" 0 1
3804 xcall bail "be juicy3"
3806 echo "~^header insert bcc juice4@exam.ple";\
3807 read es; echo $es;vput vexpr es substr "$es" 0 1
3809 xcall bail "be juicy4"
3812 echo "~^header remove-at bcc 3";\
3813 read es; echo $es;vput vexpr es substr "$es" 0 1
3815 xcall bail "remove juicy5"
3817 echo "~^header remove-at bcc 2";\
3818 read es; echo $es;vput vexpr es substr "$es" 0 1
3820 xcall bail "remove juicy6"
3822 echo "~^header remove-at bcc 3";\
3823 read es; echo $es;vput vexpr es substr "$es" 0 3
3825 xcall bail "failed to remove-at"
3827 # Add duplicates which ought to be removed!
3828 echo "~^header insert bcc juice4@exam.ple";\
3829 read es; echo $es;vput vexpr es substr "$es" 0 1
3831 xcall bail "be juicy4-1"
3833 echo "~^header insert bcc juice4@exam.ple";\
3834 read es; echo $es;vput vexpr es substr "$es" 0 1
3836 xcall bail "be juicy4-2"
3838 echo "~^header insert bcc juice4@exam.ple";\
3839 read es; echo $es;vput vexpr es substr "$es" 0 1
3841 xcall bail "be juicy4-3"
3846 call _work 3; echo $?
3848 vput ! i echo just knock if you can hear me;\
3850 while [ $i -lt 24 ]; do printf "%s " $i; i=`expr $i + 1`; done;\
3852 echon shell-cmd says $?/$^ERRNAME: $i
3853 echo "~x will not become interpreted, we are reading until __EOT"
3855 read r_status; echo "~~r status output: $r_status"
3856 echo "~:echo $? $! $^ERRNAME"
3858 echo "~~r status from parent: $r_status"
3861 call _work 4; echo $?
3862 vput cwd cwd;echo cwd:$?
3863 readctl create $cwd/.treadctl ;echo readctl:$?/$^ERRNAME;\
3867 call _work 5; echo $?
3868 echo "~^header show MAILX-Command"; read es;\
3869 call xerr $es "t_header 1000"; call read_mline_res
3870 echo "~^header show MAILX-raw-TO"; read es;\
3871 call xerr $es "t_header 1001"; xcall read_mline_res
3873 echoerr IT IS WRONG IF YOU SEE THIS
3876 echo on-compose-enter, mailx-command<$mailx-command>
3877 set t_oce autobcc=oce@exam.ple
3878 alternates alter1@exam.ple alter2@exam.ple
3880 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3881 echo mailx-subject<$mailx-subject>
3882 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3883 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3884 mailx-raw-bcc<$mailx-raw-bcc>
3885 echo mailx-orig-from<$mailx-orig-from> \
3886 mailx-orig-to<$mailx-orig-to> \
3887 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3890 echo on-compose-leave, mailx-command<$mailx-command>
3891 set t_ocl autocc=ocl@exam.ple
3893 alternates alter3@exam.ple alter4@exam.ple
3895 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3896 echo mailx-subject<$mailx-subject>
3897 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3898 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3899 mailx-raw-bcc<$mailx-raw-bcc>
3900 echo mailx-orig-from<$mailx-orig-from> \
3901 mailx-orig-to<$mailx-orig-to> \
3902 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3905 echo on-compose-cleanup, mailx-command<$mailx-command>
3906 set t_occ autocc=occ@exam.ple
3909 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3910 echo mailx-subject<$mailx-subject>
3911 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3912 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3913 mailx-raw-bcc<$mailx-raw-bcc>
3914 echo mailx-orig-from<$mailx-orig-from> \
3915 mailx-orig-to<$mailx-orig-to> \
3916 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3918 wysh set on-compose-splice=t_ocs \
3919 on-compose-splice-shell="read ver;echo t_ocs-shell;\
3920 echo \"~t shell@exam.ple\"; echo \"~:set t_ocs_sh\"" \
3921 on-compose-enter=t_oce on-compose-leave=t_ocl \
3922 on-compose-cleanup=t_occ
3924 ex0_test behave
:compose_hooks-3-estat
3925 ${cat} .
/.tnotes
>> "${MBOX}"
3927 check behave
:compose_hooks-3
- "${MBOX}" '679526364 2431'
3929 # Reply, forward, resend, Resend
3932 printf 'set from=f1@z\nm t1@z\nb1\n!.\nset from=f2@z\nm t2@z\nb2\n!.\n' |
3933 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! \
3937 echo start: $? $! $^ERRNAME
3939 echo File: $? $! $^ERRNAME;echo;echo
3941 this is content of reply 1
3943 echo reply 1: $? $! $^ERRNAME;echo;echo
3945 this is content of Reply 1 2
3947 echo Reply 1 2: $? $! $^ERRNAME;echo;echo
3948 forward 1 fwdex@am.ple
3949 this is content of forward 1
3951 echo forward 1: $? $! $^ERRNAME;echo;echo
3952 resend 1 2 resendex@am.ple
3953 echo resend 1 2: $? $! $^ERRNAME;echo;echo
3954 Resend 1 2 Resendex@am.ple
3955 echo Resend 1 2: $? $! $^ERRNAME;echo;echo
3957 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! \
3961 echoerr "Failed: $1. Bailing out"; echo "~x"; xit
3964 vput vexpr es substr "$1" 0 1
3969 define read_mline_res {
3970 read hl; wysh set len=$? es=$! en=$^ERRNAME;\
3971 echo mline_res:$len/$es/$^ERRNAME: $hl
3972 if [ $es -ne $^ERR-NONE ]
3973 xcall bail read_mline_res
3975 \xcall read_mline_res
3979 echo "~^header show $1"; read es;\
3980 call xerr $es "work_hl $1"; echo $1; call read_mline_res
3988 echo t_ocs version $ver
3989 echo "~^header list"; read hl; echo $hl;\
3990 echoerr the header list is $hl;\
3991 call xerr "$hl" "header list"
3992 eval vpospar set $hl
3995 echoerr IT IS WRONG IF YOU SEE THIS
3998 echo on-XY-enter, mailx-command<$mailx-command>
3999 set t_oce autobcc=oce@exam.ple
4000 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
4001 echo mailx-subject<$mailx-subject>
4002 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
4003 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
4004 mailx-raw-bcc<$mailx-raw-bcc>
4005 echo mailx-orig-from<$mailx-orig-from> \
4006 mailx-orig-to<$mailx-orig-to> \
4007 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
4010 echo on-XY-leave, mailx-command<$mailx-command>
4011 set t_ocl autocc=ocl@exam.ple
4012 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
4013 echo mailx-subject<$mailx-subject>
4014 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
4015 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
4016 mailx-raw-bcc<$mailx-raw-bcc>
4017 echo mailx-orig-from<$mailx-orig-from> \
4018 mailx-orig-to<$mailx-orig-to> \
4019 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
4022 echo on-XY-cleanup, mailx-command<$mailx-command>
4023 set t_occ autocc=occ@exam.ple
4024 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
4025 echo mailx-subject<$mailx-subject>
4026 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
4027 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
4028 mailx-raw-bcc<$mailx-raw-bcc>
4029 echo mailx-orig-from<$mailx-orig-from> \
4030 mailx-orig-to<$mailx-orig-to> \
4031 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
4033 wysh set on-compose-splice=t_ocs \
4034 on-compose-enter=t_oce on-compose-leave=t_ocl \
4035 on-compose-cleanup=t_occ \
4036 on-resend-enter=t_oce on-resend-cleanup=t_occ
4038 ex0_test behave
:compose_hooks-4-estat
4039 ${cat} .
/.tnotes
>> "${MBOX}"
4041 check behave
:compose_hooks-4
- "${MBOX}" '3038884027 7516'
4046 t_behave_C_opt_customhdr
() {
4047 t_prolog t_behave_C_opt_customhdr
4048 TRAP_EXIT_ADDONS
="./.t*"
4050 t_xmta
'CimicifugaRacemosa Mon Dec 25 21:33:40 2017'
4053 ${MAILX} ${ARGS} -Smta=.
/.tmta.sh \
4054 -C 'C-One : Custom One Body' \
4055 -C 'C-Two:CustomTwoBody' \
4056 -S customhdr
='chdr1: chdr1 body, chdr2:chdr2 body' \
4057 this-goes@nowhere
>.
/.tall
2>&1
4058 ex0_test behave
:C_opt_customhdr-1-estat
4059 ${cat} .
/.tall
>> "${MBOX}"
4060 check behave
:C_opt_customhdr-1
0 "${MBOX}" '2400078426 195'
4063 printf 'm this-goes@nowhere\nbody\n!.
4065 m this-goes2@nowhere\nbody2\n!.
4066 set customhdr=%ccustom1 : custom1 body%c
4067 m this-goes2@nowhere\nbody2\n!.
4068 set customhdr=%ccustom1 : custom1\\, body , custom2: custom2 body%c
4069 m this-goes3@nowhere\nbody3\n!.
4071 ${MAILX} ${ARGS} -Smta=.
/.tmta.sh
-Sescape=! \
4072 -C 'C-One : Custom One Body' \
4073 -C 'C-Two:CustomTwoBody' \
4074 -S customhdr
='chdr1: chdr1 body, chdr2:chdr2 body' \
4076 ex0_test behave
:C_opt_customhdr-2-estat
4077 ${cat} .
/.tall
>> "${MBOX}"
4078 check behave
:C_opt_customhdr-2
0 "${MBOX}" '3546878678 752'
4083 t_behave_quote_a_cmd_escapes
() {
4084 t_prolog t_behave_quote_a_cmd_escapes
4085 TRAP_EXIT_ADDONS
="./.t*"
4089 echo 'included file' > .
/.ttxt
4091 ${cat} <<-_EOT > ./.tmbox
4092 From neverneverland Sun Jul 23 13:46:25 2017
4093 Subject: Bugstop: five miles out 1
4094 Reply-To: mister originator1 <mr1@originator>
4095 From: mister originator1 <mr1@originator>
4096 To: bugstop-commit@five.miles.out
4098 In-reply-to: <20170719111113.bkcMz%laber1@backe.eu>
4099 Date: Wed, 19 Jul 2017 09:22:57 -0400
4100 Message-Id: <20170719132257.766AF781267-1@originator>
4103 That's appalling, I.
4105 From neverneverland Sun Jul 23 13:47:25 2017
4106 Subject: Bugstop: five miles out 2
4107 Reply-To: mister originator2 <mr2@originator>
4108 From: mister originator2 <mr2@originator>
4109 To: bugstop-commit@five.miles.out
4111 In-reply-to: <20170719111113.bkcMz%laber2@backe.eu>
4112 Date: Wed, 19 Jul 2017 09:23:57 -0400
4113 Message-Id: <20170719132257.766AF781267-2@originator>
4116 That's appalling, II.
4118 From neverneverland Sun Jul 23 13:48:25 2017
4119 Subject: Bugstop: five miles out 3
4120 Reply-To: mister originator3 <mr3@originator>
4121 From: mister originator3 <mr3@originator>
4122 To: bugstop-commit@five.miles.out
4124 In-reply-to: <20170719111113.bkcMz%laber3@backe.eu>
4125 Date: Wed, 19 Jul 2017 09:24:57 -0400
4126 Message-Id: <20170719132257.766AF781267-3@originator>
4129 That's appalling, III.
4134 set indentprefix=" |"
4141 headerpick type retain cc date from message-id reply-to subject to
4145 set quote=allheaders
4148 ' |
${MAILX} ${ARGS} -Smta=.
/.tmta.sh
-Rf \
4149 -Sescape=! -Sindentprefix=' >' \
4150 .
/.tmbox
>.
/.tall
2>&1
4151 ex0_test behave
:quote_a_cmd_escapes-1-estat
4152 ${cat} .
/.tall
>> "${MBOX}"
4153 check behave
:quote_a_cmd_escapes-1
0 "${MBOX}" '3048941846 2023'
4155 # ~@ is tested with other attachment stuff, ~^ is in compose_hooks
4158 set Sign=SignVar sign=signvar DEAD=./.ttxt
4159 headerpick type retain Subject
4161 !!1 Not escaped. And shell test last, right before !..
4162 !: echo 2 only echoed via colon
4163 !_ echo 3 only echoed via underscore
4165 !<! echo 5 shell echo included
4166 !| echo 6 pipecmd-pre; cat; echo 6 pipecmd-post
4167 7 and 8 are ~A and ~a:
4170 !b 9 added ~b cc <ex1@am.ple>
4171 !c 10 added ~c c <ex2@am.ple>
4178 14: ~f (headerpick: subject)
4182 16, 17: ~I Sign, ~i Sign
4197 24: ~s this new subject
4198 !s 24 did new ~s ubject
4199 !t 25 added ~t o <ex3@am.ple>
4204 and i ~w rite this out to ./.tmsg
4206 !:wysh set x=$escape;set escape=~
4207 ~!echo shell command output
4208 ~:wysh set escape=$x
4210 ' |
${MAILX} ${ARGS} -Smta=.
/.tmta.sh
-Rf \
4211 -Sescape=! -Sindentprefix=' |' \
4212 .
/.tmbox
>.
/.tall
2>&1
4213 ex0_test behave
:quote_a_cmd_escapes-2-estat
4214 ${cat} .
/.tall
>> "${MBOX}"
4215 check behave
:quote_a_cmd_escapes-2
0 "${MBOX}" '375879934 3604'
4216 check behave
:quote_a_cmd_escapes-3
- .
/.tmsg
'2112542907 2789'
4221 t_behave_mass_recipients
() {
4222 t_prolog t_behave_mass_recipients
4223 TRAP_EXIT_ADDONS
="./.t*"
4225 t_xmta
'Eucalyptus Sat Jul 08 21:14:57 2017'
4227 ${cat} <<'__EOT__' > ./.trc
4229 echoerr "Failed: $1. Bailing out"; echo "~x"; xit
4232 wysh set nr=$1 hn=$2
4233 echo "~$hn $hn$nr@$hn"; echo '~:echo $?'; read es
4235 xcall bail "ins_addr $hn 1-$nr"
4237 vput vexpr nr + $nr 1
4238 if [ "$nr" -le "$maximum" ]
4239 xcall ins_addr $nr $hn
4243 wysh set nr=$1 hn=$2
4244 alternates $hn$nr@$hn
4245 vput vexpr nr + $nr 2
4246 if [ "$nr" -le "$maximum" ]
4247 xcall bld_alter $nr $hn
4257 if [ "$t_remove" != '' ]
4262 set on-compose-splice=t_ocs on-compose-leave=t_ocl
4265 printf 'm this-goes@nowhere\nbody\n!.\n' |
4266 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
4267 -X'source ./.trc' -Smta=.
/.tmta.sh
-Smaximum=2001 \
4269 ex0_test behave
:mass_recipients-1-estat
4270 ${cat} .
/.tall
>> "${MBOX}"
4271 check behave
:mass_recipients-1
- "${MBOX}" '2912243346 51526'
4274 printf 'm this-goes@nowhere\nbody\n!.\n' |
4275 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
4276 -St_remove=1 -X'source ./.trc' -Smta=.
/.tmta.sh
-Smaximum=2001 \
4278 ex0_test behave
:mass_recipients-2-estat
4279 ${cat} .
/.tall
>> "${MBOX}"
4280 check behave
:mass_recipients-2
- "${MBOX}" '4097804632 34394'
4285 t_behave_mime_types_load_control
() {
4286 t_prolog t_behave_mime_types_load_control
4287 if have_feat uistrings
; then :; else
4288 echo 'behave:mime_types_load_control: unsupported, skipped'
4291 TRAP_EXIT_ADDONS
="./.t*"
4293 ${cat} <<-_EOT > ./.tmts1
4294 @ application/mathml+xml mathml
4296 ${cat} <<-_EOT > ./.tmts2
4297 @ x-conference/x-cooltalk ice
4299 @ application/aga-aga aga
4302 ${cat} <<-_EOT > ./.tmts1.mathml
4303 <head>nonsense ML</head>
4305 ${cat} <<-_EOT > ./.tmts2.ice
4308 printf 'of which the c\x01rack is coming soon' > .
/.tmtsx.doom
4309 printf 'of which the c\x01rack is coming soon' > .
/.tmtsx.aga
4323 ' "${MBOX}" "${MBOX}" |
4325 -Smimetypes-load-control=f
=.
/.tmts1
,f
=.
/.tmts2 \
4327 ex0_test behave
:mime_types_load_control-1-estat
4328 ${cat} "${MBOX}" >> .
/.tout
4329 check behave
:mime_types_load_control-1
- .
/.tout
'1441260727 2449'
4331 echo type |
${MAILX} ${ARGS} -R \
4332 -Smimetypes-load-control=f
=.
/.tmts1
,f
=.
/.tmts3 \
4333 -f "${MBOX}" >> .
/.tout
2>&1
4334 check behave
:mime_types_load_control-2
0 .
/.tout
'1441391438 3646'
4339 t_behave_lreply_futh_rth_etc
() {
4340 t_prolog t_behave_lreply_futh_rth_etc
4341 TRAP_EXIT_ADDONS
="./.t*"
4343 t_xmta
'HumulusLupulus Thu Jul 27 14:41:20 2017'
4345 ${cat} <<-_EOT > ./.tmbox
4346 From neverneverland Sun Jul 23 13:46:25 2017
4347 Subject: Bugstop: five miles out 1
4348 Reply-To: mister originator2 <mr2@originator>, bugstop@five.miles.out
4349 From: mister originator <mr@originator>
4350 To: bugstop-commit@five.miles.out, laber@backe.eu
4352 Mail-Followup-To: bugstop@five.miles.out, laber@backe.eu, is@a.list
4353 In-reply-to: <20170719111113.bkcMz%laber@backe.eu>
4354 Date: Wed, 19 Jul 2017 09:22:57 -0400
4355 Message-Id: <20170719132257.766AF781267@originator>
4358 > |Sorry, I think I misunderstand something. I would think that
4362 From neverneverland Fri Jul 7 22:39:11 2017
4363 Subject: Bugstop: five miles out 2
4364 Reply-To: mister originator2<mr2@originator>,bugstop@five.miles.out,is@a.list
4365 Content-Transfer-Encoding: 7bit
4366 From: mister originator <mr@originator>
4367 To: bugstop-commit@five.miles.out
4369 Message-ID: <149945963975.28888.6950788126957753723.reportbug@five.miles.out>
4370 Date: Fri, 07 Jul 2017 16:33:59 -0400
4373 capable of changing back.
4375 From neverneverland Fri Jul 7 22:42:00 2017
4376 Subject: Bugstop: five miles out 3
4377 Reply-To: mister originator2 <mr2@originator>, bugstop@five.miles.out
4378 Content-Transfer-Encoding: 7bit
4379 From: mister originator <mr@originator>
4380 To: bugstop-commit@five.miles.out
4382 Message-ID: <149945963975.28888.6950788126957753746.reportbug@five.miles.out>
4383 Date: Fri, 07 Jul 2017 16:33:59 -0400
4384 List-Post: <mailto:bugstop@five.miles.out>
4387 are you ready, boots?
4389 From neverneverland Sat Aug 19 23:15:00 2017
4390 Subject: Bugstop: five miles out 4
4391 Reply-To: mister originator2 <mr2@originator>, bugstop@five.miles.out
4392 Content-Transfer-Encoding: 7bit
4393 From: mister originator <mr@originator>
4394 To: bugstop@five.miles.out
4396 Message-ID: <149945963975.28888.6950788126qtewrqwer.reportbug@five.miles.out>
4397 Date: Fri, 07 Jul 2017 16:33:59 -0400
4398 List-Post: <mailto:bugstop@five.miles.out>
4401 are you ready, boots?
4406 ${cat} <<-'_EOT' | ${MAILX} ${ARGS} -Sescape=! -Smta=.
/.tmta.sh \
4407 -Rf .
/.tmbox
>> "${MBOX}" 2>&1
4409 wysh
set m
="This is text of \"reply ${1}."
4420 echo -----After reply $1.1 - $1.3: $?/$^ERRNAME
4423 wysh set m="This is text of
\"Reply
${1}.
"
4429 echo -----After Reply
$1.
$2: $?
/$^ERRNAME
4438 wysh
set m
="This is text of \"Lreply ${1}." on-compose-splice
=_Lh n
=$2
4442 # We need two indirections for this test: one for the case that Lreply
4443 # fails because of missing recipients: we need to read EOF next, thus
4444 # place this in _Ls last; and second for the succeeding cases EOF is
4445 # not what these should read, so go over the backside and splice it in!
4447 echo -----After Lreply
$1.
$2: $?
/$^ERRNAME
4450 localopts call-fixate
yes
4452 call R
$1 1; call R
$1 2; call R
$1 3; call R
$1 4
4453 call L
$1 1; call L
$1 2; call L
$1 3
4456 echo;echo '===== CHANGING === '"$*"' =====';echo
4460 set from
=laber@backe.eu
4463 call tweak
set reply-to-honour
4465 call tweak
set followup-to
4467 call tweak
set followup-to-honour
4469 call tweak mlist bugstop@five.miles.out
4471 call tweak mlsubscribe bugstop@five.miles.out
4473 call tweak
set recipients-in-cc
4477 ex0_test behave
:lreply_futh_rth_etc-1-estat
4478 if have_feat uistrings
; then # xxx should not be so, skip??
4479 check behave
:lreply_futh_rth_etc-1
- "${MBOX}" '940818845 29373'
4481 check behave
:lreply_futh_rth_etc-1
- "${MBOX}" '3917430455 29259'
4486 ${cat} <<-_EOT > ./.tmbox
4487 From tom@i-i.example Thu Oct 26 03:15:55 2017
4488 Date: Wed, 25 Oct 2017 21:15:46 -0400
4489 From: tom <tom@i-i.example>
4490 To: Steffen Nurpmeso <steffen@sdaoden.eu>
4491 Cc: tom <tom@i-i.example>
4492 Subject: Re: xxxx yyyyyyyy configure does not really like a missing zzzzz
4493 Message-ID: <20171026011546.GA11643@i-i.example>
4494 Reply-To: tom@i-i.example
4495 References: <20171025214601.T2pNd%steffen@sdaoden.eu>
4496 In-Reply-To: <20171025214601.T2pNd%steffen@sdaoden.eu>
4499 The report's useful :-)
4502 printf 'reply 1\nthank you\n!.\n' |
4503 ${MAILX} ${ARGS} -Sescape=! -Smta=.
/.tmta.sh
-Sreply-to-honour \
4504 -Rf .
/.tmbox
> "${MBOX}" 2>&1
4505 check behave
:lreply_futh_rth_etc-2
0 "${MBOX}" '1045866991 331'
4510 t_behave_mime_if_not_ascii
() {
4511 t_prolog t_behave_mime_if_not_ascii
4513 </dev
/null
${MAILX} ${ARGS} -s Subject "${MBOX}" >> "${MBOX}" 2>&1
4514 check behave:mime_if_not_ascii-1 0 "${MBOX}" '2287855519 110'
4516 </dev/null ${MAILX} ${ARGS} -Scharset-7bit=not-ascii -s Subject "${MBOX}" \
4518 check behave
:mime_if_not_ascii-2
0 "${MBOX}" '70754682 282'
4523 t_behave_xxxheads_rfc2047
() {
4524 t_prolog t_behave_xxxheads_rfc2047
4525 TRAP_EXIT_ADDONS
="./.t*"
4527 t_xmta
'GentianaLutea Mon Dec 04 17:15:29 2017'
4529 echo |
${MAILX} ${ARGS} ${ADDARG_UNI} \
4530 -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̲' \
4532 check behave
:xxxheads_rfc2047-1
0 "${MBOX}" '3370931614 375'
4534 # Single word (overlong line split -- bad standard! Requires injection of
4535 # artificial data!! But can be prevented by using RFC 2047 encoding)
4537 i
=`${awk} 'BEGIN{for(i=0; i<92; ++i) printf "0123456789_"}'`
4538 echo |
${MAILX} ${ARGS} -s "${i}" "${MBOX}"
4539 check behave:xxxheads_rfc2047-2 0 "${MBOX}" '489922370 1718'
4541 # Combination of encoded words, space and tabs of varying sort
4543 echo | ${MAILX} ${ARGS} ${ADDARG_UNI} \
4544 -s "1Abrä Kaspas1
2Abra Katä b_kaspas2 \
4545 3Abrä Kaspas3
4Abrä Kaspas4
5Abrä Kaspas5 \
4546 6Abra Kaspas6
7Abrä Kaspas7
8Abra Kaspas8 \
4547 9Abra Kaspastäb4-3
10Abra Kaspas1 _
11Abra Katäb1 \
4548 12Abra Kadabrä
1 After Tab after Täb this is NUTS
" \
4550 check behave:xxxheads_rfc2047-3 0 "${MBOX}" '1676887734 591'
4552 # Overlong multibyte sequence that must be forcefully split
4553 # todo This works even before v15.0, but only by accident
4555 echo | ${MAILX} ${ARGS} ${ADDARG_UNI} \
4556 -s "✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄\
4557 ✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄\
4558 ✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄
" \
4560 check behave:xxxheads_rfc2047-4 0 "${MBOX}" '3029301775 659'
4564 echo | ${MAILX} ${ARGS} \
4565 -s "1-1 B2 B3 B4 B5 B6 B\
4566 1-2 B2 B3 B4 B5 B6 B\
4567 1-3 B2 B3 B4 B5 B6 B\
4568 1-4 B2 B3 B4 B5 B6 B\
4569 1-5 B2 B3 B4 B5 B6 B\
4570 1-6 B2 B3 B4 B5 B6
" \
4572 check behave:xxxheads_rfc2047-5 0 "${MBOX}" '4126167195 297'
4574 # Leading and trailing WS
4576 echo | ${MAILX} ${ARGS} \
4577 -s " 2-1 B2 B3 B4 B5 B6 B\
4578 1-2 B2 B3 B4 B5 B6 B\
4579 1-3 B2 B3 B4 B5 B6 B\
4580 1-4 B2 B3 B4 B5 B6
" \
4582 check behave:xxxheads_rfc2047-6 0 "${MBOX}" '3600624479 236'
4584 # RFC 2047 in an address field! (Missing test caused v14.9.6!)
4586 echo "Dat Früchtchen riecht häußlich
" |
4587 ${MAILX} ${ARGS} ${ADDARG_UNI} -Sfullnames -Smta=./.tmta.sh \
4589 'Schnödes "Früchtchen
" <do@du> (Hä!)'
4590 check behave:xxxheads_rfc2047-7 0 "${MBOX}" '800505986 368'
4592 # RFC 2047 in an address field, and iconv involved
4593 if have_feat iconv; then
4595 ${cat} > ./.trebox <<_EOT
4596 From zaza@exam.ple Fri Mar 2 21:31:56 2018
4597 Date: Fri, 2 Mar 2018 20:31:45 +0000
4598 From: z=?iso-8859-1?Q?=E1?=za <zaza@exam.ple>
4599 To: dude <dude@exam.ple>
4600 Subject: houston(...)
4601 Message-ID: <abra@1>
4603 Content-Type: text/plain; charset=iso-8859-1
4604 Content-Disposition: inline
4605 Content-Transfer-Encoding: 8bit
4608 echo reply | ${MAILX} ${ARGS} ${ADDARG_UNI} \
4609 -Sfullnames -Sreply-in-same-charset \
4610 -Smta=./.tmta.sh -Rf ./.trebox
4611 check behave:xxxheads_rfc2047-8 0 "${MBOX}" '2821484185 280'
4613 echo 'behave:xxxheads_rfc2047-8: iconv unsupported, skipped'
4619 t_behave_rfc2231() {
4620 t_prolog t_behave_rfc2231
4621 TRAP_EXIT_ADDONS=".
/.t
*"
4624 mkdir ./.ttt || exit 1
4628 : > 'diet\ is \curd.txt'
4629 : > 'diet "is
" curd.txt'
4631 : > 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
4632 : > höde__tröge__müde__dätte__hätte__vuelle__guelle__aese__aesse__sauerliche__kräuter__österliche__grüße__mäh.txt
4633 : > hööööööööööööööööö_nöööööööööööööööööööööö_düüüüüüüüüüüüüüüüüüü_bäääääääääääääääääääääääh.txt
4634 : > ✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆.txt
4636 echo bla | ${MAILX} ${ARGS} ${ADDARG_UNI} \
4637 -a ".
/.ttt
/ma
'ger.txt" -a "./.ttt/mä'ger.txt
" \
4638 -a './.ttt/diet\ is \curd.txt' -a './.ttt/diet "is
" curd.txt' \
4639 -a ./.ttt/höde-tröge.txt \
4640 -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 \
4641 -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 \
4642 -a ./.ttt/hööööööööööööööööö_nöööööööööööööööööööööö_düüüüüüüüüüüüüüüüüüü_bäääääääääääääääääääääääh.txt \
4643 -a ./.ttt/✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆.txt \
4645 check behave:rfc2231-1 0 "${MBOX}" '684985954 3092'
4647 # `resend' test, reusing $MBOX
4648 printf "Resend .
/.t2
\nx
\n" | ${MAILX} ${ARGS} -Rf "${MBOX}"
4649 check behave
:rfc2231-2
0 .
/.t2
'684985954 3092'
4651 printf "resend ./.t3\nx\n" |
${MAILX} ${ARGS} -Rf "${MBOX}"
4652 check behave:rfc2231-3 0 ./.t3 '3130352658 3148'
4657 t_behave_iconv_mbyte_base64() { # TODO uses sed(1) and special *headline*!!
4658 t_prolog t_behave_iconv_mbyte_base64
4659 TRAP_EXIT_ADDONS=".
/.t
*"
4661 if [ -n "${UTF8_LOCALE}" ] && have_feat iconv; then
4662 if (</dev/null iconv -f ascii -t iso-2022-jp) >/dev/null 2>&1 ||
4663 (</dev/null iconv -f ascii -t euc-jp) >/dev/null 2>&1; then
4666 echo 'behave:iconv_mbyte_base64: unsupported, skipped'
4670 echo 'behave:iconv_mbyte_base64: unsupported, skipped'
4674 t_xmta 'DroseriaRotundifolia Thu Aug 03 17:26:25 2017'
4676 if (</dev/null iconv -f ascii -t iso-2022-jp) >/dev/null 2>&1; then
4677 ${cat} <<-'_EOT' | LC_ALL=${UTF8_LOCALE} ${MAILX} ${ARGS} \
4679 -Sescape=! -Smime-encoding=base64 2>./.terr
4680 set ttycharset=utf-8 sendcharsets=iso-2022-jp
4682 !s Japanese from UTF-8 to ISO-2022-JP
4683 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの1種をシジュウカラと呼ぶ。
4685 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
4688 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
4690 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの1種をシジュウカラと呼ぶ。
4693 set ttycharset=iso-2022-jp charset-7bit=iso-2022-jp sendcharsets=utf-8
4695 !s Japanese from ISO-2022-JP to UTF-8, eh, no, also ISO-2022-JP
4696 \e$B%7%8%e%&%+%i2J!J%7%8%e%&%+%i$+!"3XL
>\e(B Paridae
\e$B!K
$O!"D;N`%9%:%aL\$N2J$G$"$k!#%7%8%e%&%+%i!J;M==?}!K$HAm>N$5$l$k$,!"695A$K$O$3$N\e(B1\e$B<o$r%7%8%e%&%+%i$H8F$V!#\e(B
4698 \e$B%+%s
%`%j%,%i!J3XL>\e(BParus cristatus\e$B!K$O!"%9%:%aL\%7%8%e%&%+%i2J$KJ,N`$5$l$kD;N
`$N0l<o!#\e(B
4701 \e$B%+%s%`%j
%,%i
!J3XL
>\e(BParus cristatus
\e$B!K
$O!"%9%:%aL\%7%8%e%&%+%i2J$KJ,N`$5$l$kD;N`$N0l<o!#\e(B
4703 \e$B%7%8%e%&%+%i2J!J%7%8%e%&%+%i$+!"3XL
>\e(B Paridae
\e$B!K
$O!"D;N`%9%:%aL\$N2J$G$"$k!#%7%8%e%&%+%i!J;M==?}!K$HAm>N$5$l$k$,!"695A$K$O$3$N\e(B1\e$B<o$r%7%8%e%&%+%i$H8F$V!#\e(B
4706 # May not presume iconv output as long as roundtrip possible [489a7122]
4707 ex0_test behave
:iconv_mbyte_base64-1-estat
4708 ${awk} 'BEGIN{h=1}/^$/{++h;next}{if(h % 2 == 1)print}' \
4709 < "${MBOX}" > .
/.tcksum
4710 check behave
:iconv_mbyte_base64-1
- .
/.tcksum
'2694609714 520'
4711 check behave
:iconv_mbyte_base64-2
- .
/.terr
'4294967295 0'
4713 printf 'eval f 1; eval write ./.twrite; eval type 1; eval type 2\n' |
4714 LC_ALL
=${UTF8_LOCALE} ${MAILX} ${ARGS} \
4715 -S headline
="%>%a%m %-18f %-16d %i%-s" \
4716 -Rf "${MBOX}" >.
/.tlog
2>&1
4717 check behave
:iconv_mbyte_base64-3
0 .
/.twrite
'1259742080 686'
4718 #check behave:iconv_mbyte_base64-4 - ./.tlog '3214068822 2123'
4719 ${sed} -e '/^\[-- M/d' < .
/.tlog
> .
/.txlog
4720 check behave
:iconv_mbyte_base64-4
- .
/.txlog
'3659773472 2035'
4722 echo 'behave:iconv_mbyte_base64: ISO-2022-JP unsupported, skipping 1-4'
4725 if (</dev
/null
iconv -f ascii
-t euc-jp
) >/dev
/null
2>&1; then
4726 rm -f "${MBOX}" .
/.twrite
4727 ${cat} <<-'_EOT' | LC_ALL=${UTF8_LOCALE} ${MAILX} ${ARGS} \
4729 -Sescape=! -Smime-encoding=base64
2>.
/.terr
4730 set ttycharset
=utf-8 sendcharsets
=euc-jp
4732 !s Japanese from UTF-8 to EUC-JP
4733 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの
1種をシジュウカラと呼ぶ。
4735 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
4738 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
4740 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの
1種をシジュウカラと呼ぶ。
4743 set ttycharset
=EUC-JP sendcharsets
=utf-8
4745 !s Japanese from EUC-JP to UTF-8
4746 ¥·¥¸¥å¥¦¥«¥é²Ê¡Ê¥·¥¸¥å¥¦¥«¥é¤«¡¢³Ø̾ Paridae¡Ë¤Ï¡¢Ä»Îॹ¥º¥áÌܤβʤǤ¢¤ë¡£¥·¥¸¥å¥¦¥«¥é¡Ê»Í½½¿ý¡Ë¤ÈÁí¾Î¤µ¤ì¤ë¤¬¡¢¶¹µÁ¤Ë¤Ï¤³¤Î
1¼ï¤ò¥·¥¸¥å¥¦¥«¥é¤È¸Æ¤Ö¡£
4748 ¥«¥ó¥à¥ê¥¬¥é¡Ê³Ø̾Parus cristatus¡Ë¤Ï¡¢¥¹¥º¥áÌÜ¥·¥¸¥å¥¦¥«¥é²Ê¤ËʬÎव¤ì¤ëÄ»Îà¤Î°ì¼ï¡£
4751 ¥«¥ó¥à¥ê¥¬¥é¡Ê³Ø̾Parus cristatus¡Ë¤Ï¡¢¥¹¥º¥áÌÜ¥·¥¸¥å¥¦¥«¥é²Ê¤ËʬÎव¤ì¤ëÄ»Îà¤Î°ì¼ï¡£
4753 ¥·¥¸¥å¥¦¥«¥é²Ê¡Ê¥·¥¸¥å¥¦¥«¥é¤«¡¢³Ø̾ Paridae¡Ë¤Ï¡¢Ä»Îॹ¥º¥áÌܤβʤǤ¢¤ë¡£¥·¥¸¥å¥¦¥«¥é¡Ê»Í½½¿ý¡Ë¤ÈÁí¾Î¤µ¤ì¤ë¤¬¡¢¶¹µÁ¤Ë¤Ï¤³¤Î
1¼ï¤ò¥·¥¸¥å¥¦¥«¥é¤È¸Æ¤Ö¡£
4756 ex0_test behave
:iconv_mbyte_base64-5-estat
4757 ${awk} 'BEGIN{h=1}/^$/{++h;next}{if(h % 2 == 1)print}' \
4758 < "${MBOX}" > .
/.tcksum
4759 check behave
:iconv_mbyte_base64-5
- .
/.tcksum
'2870183985 473'
4760 check behave
:iconv_mbyte_base64-6
- .
/.terr
'4294967295 0'
4762 printf 'eval f 1; eval write ./.twrite; eval type 1; eval type 2\n' |
4763 LC_ALL
=${UTF8_LOCALE} ${MAILX} ${ARGS} \
4764 -S headline
="%>%a%m %-18f %-16d %i%-s" \
4765 -Rf "${MBOX}" >.
/.tlog
2>&1
4766 check behave
:iconv_mbyte_base64-7
0 .
/.twrite
'1259742080 686'
4767 #check behave:iconv_mbyte_base64-8 - ./.tlog '2506063395 2075'
4768 ${sed} -e '/^\[-- M/d' < .
/.tlog
> .
/.txlog
4769 check behave
:iconv_mbyte_base64-8
- .
/.txlog
'2528199891 1988'
4771 echo 'behave:iconv_mbyte_base64: EUC-JP unsupported, skipping 5-8'
4777 t_behave_iconv_mainbody
() {
4778 t_prolog t_behave_iconv_mainbody
4779 TRAP_EXIT_ADDONS
="./.t*"
4781 if [ -n "${UTF8_LOCALE}" ] && have_feat
iconv; then
4784 echo 'behave:iconv_mainbody: unsupported, skipped'
4788 t_xmta
'HamamelisVirginiana Fri Oct 20 16:23:21 2017'
4790 printf '–' |
${MAILX} ${ARGS} ${ADDARG_UNI} -Smta=.
/.tmta.sh \
4791 -S charset-7bit
=us-ascii
-S charset-8bit
=utf-8 \
4792 -s '–' over-the@rain.bow
2>.
/.terr
4793 check behave
:iconv_mainbody-1
0 "${MBOX}" '3634015017 251'
4794 check behave
:iconv_mainbody-2
- .
/.terr
'4294967295 0'
4796 printf '–' |
${MAILX} ${ARGS} ${ADDARG_UNI} -Smta=.
/.tmta.sh \
4797 -S charset-7bit
=us-ascii
-S charset-8bit
=us-ascii \
4798 -s '–' over-the@rain.bow
2>.
/.terr
4799 exn0_test behave
:iconv_mainbody-3
4800 check behave
:iconv_mainbody-3
- "${MBOX}" '3634015017 251'
4801 if have_feat uistrings
; then
4802 if have_feat docstrings
; then # xxx should not be like that
4803 check behave
:iconv_mainbody-4
- .
/.terr
'2579894983 148'
4805 check behave
:iconv_mainbody-4
- .
/.terr
'271380835 121'
4808 echo 'behave:iconv_mainbody-4: unsupported, skipped'
4811 # The different iconv(3) implementations use different replacement sequence
4812 # types (character-wise, byte-wise, and the character(s) used differ)
4813 i
="${MAILX_ICONV_MODE}"
4814 if [ -n "${i}" ]; then
4815 printf 'p\nx\n' |
${MAILX} ${ARGS} -Rf "${MBOX}" >./.tout 2>./.terr
4817 ex0_test behave:iconv_mainbody-5-0 ${j}
4818 check behave:iconv_mainbody-5-1 - ./.terr '4294967295 0'
4819 if [ ${i} -eq 13 ]; then
4820 check behave:iconv_mainbody-5-2 - ./.tout '189327996 283'
4821 elif [ ${i} -eq 12 ]; then
4822 check behave:iconv_mainbody-5-3 - ./.tout '1959197095 283'
4823 elif [ ${i} -eq 3 ]; then
4824 check behave:iconv_mainbody-5-4 - ./.tout '3196380198 279'
4826 check behave:iconv_mainbody-5-5 - ./.tout '3760313827 279'
4829 echo 'behave:iconv_mainbody-5: unsupported, skipped'
4835 t_behave_binary_mainbody() {
4836 t_prolog t_behave_binary_mainbody
4837 TRAP_EXIT_ADDONS=".
/.t
*"
4839 printf 'abra\0\nka\r\ndabra' |
4840 ${MAILX} ${ARGS} ${ADDARG_UNI} -s 'binary with carriage-return!' \
4842 check behave:binary_mainbody-1 0 "${MBOX}" '2430168141 243'
4843 check behave:binary_mainbody-2 - ./.terr '4294967295 0'
4845 printf 'p\necho\necho writing now\nwrite ./.twrite\n' |
4846 ${MAILX} ${ARGS} -Rf \
4847 -Spipe-application/octet-stream="@
* ${cat} > .
/.tcat
" \
4848 "${MBOX}" >./.tall 2>&1
4849 check behave:binary_mainbody-3 0 ./.tall '1151843761 324'
4850 check behave:binary_mainbody-4 - ./.tcat '3817108933 15'
4851 check behave:binary_mainbody-5 - ./.twrite '3817108933 15'
4856 t_behave_q_t_etc_opts() {
4857 t_prolog t_behave_q_t_etc_opts
4858 TRAP_EXIT_ADDONS=".
/.t
*"
4860 # Three tests for MIME encoding and (a bit) content classification.
4861 # At the same time testing -q FILE, < FILE and -t FILE
4862 t__put_body > ./.tin
4864 < ./.tin ${MAILX} ${ARGS} ${ADDARG_UNI} \
4865 -a ./.tin -s "`t__put_subject`" "${MBOX}"
4866 check behave:q_t_etc_opts-1 0 "${MBOX}" '3570973309 6646'
4869 < /dev/null ${MAILX} ${ARGS} ${ADDARG_UNI} \
4870 -a ./.tin -s "`t__put_subject`" -q ./.tin "${MBOX}"
4871 check behave:q_t_etc_opts-2 0 "${MBOX}" '3570973309 6646'
4874 ( echo "To
: ${MBOX}" && echo "Subject
: `t__put_subject`" && echo &&
4876 ) | ${MAILX} ${ARGS} ${ADDARG_UNI} -Snodot -a ./.tin -t
4877 check behave:q_t_etc_opts-3 0 "${MBOX}" '3570973309 6646'
4883 have_feat smime || {
4884 echo 'behave:s/mime: unsupported, skipped'
4888 t_prolog t_behave_s_mime
4889 TRAP_EXIT_ADDONS=".
/.t.conf .
/.tkey.pem .
/.tcert.pem .
/.tpair.pem
"
4890 TRAP_EXIT_ADDONS="${TRAP_EXIT_ADDONS} .
/.VERIFY .
/.DECRYPT .
/.ENCRYPT
"
4891 TRAP_EXIT_ADDONS="${TRAP_EXIT_ADDONS} .
/.tmta.sh
"
4893 printf 'behave:s/mime: .. generating test key and certificate ..\n'
4894 ${cat} <<-_EOT > ./.t.conf
4897 default_keyfile = keyfile.pem
4898 distinguished_name = req_distinguished_name
4899 attributes = req_attributes
4903 [ req_distinguished_name ]
4910 emailAddress = test@localhost
4915 openssl req -x509 -nodes -days 3650 -config ./.t.conf \
4916 -newkey rsa:1024 -keyout ./.tkey.pem -out ./.tcert.pem >>${ERR} 2>&1
4917 ${cat} ./.tkey.pem ./.tcert.pem > ./.tpair.pem
4920 printf 'behave:s/mime:sign/verify: '
4921 echo bla | ${MAILX} ${ARGS} \
4922 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
4923 -Ssmime-sign -Sfrom=test@localhost \
4924 -s 'S/MIME test' ./.VERIFY
4925 if [ $? -eq 0 ]; then
4936 /^Content-Description: /{ skip = 2; print; next }
4937 /^$/{ if(skip) --skip }
4940 < ./.VERIFY > "${MBOX}"
4941 check behave:s/mime:sign/verify:checksum - "${MBOX}" '2900817158 648'
4943 printf 'behave:s/mime:sign/verify:verify '
4944 printf 'verify\nx\n' |
4946 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
4947 -Ssmime-sign -Sfrom=test@localhost \
4949 -f ./.VERIFY >>${ERR} 2>&1
4950 if [ $? -eq 0 ]; then
4959 printf 'behave:s/mime:sign/verify:disproof-1 '
4960 if openssl smime -verify -CAfile ./.tcert.pem \
4961 -in ./.VERIFY >>${ERR} 2>&1; then
4970 # (signing +) encryption / decryption
4971 t_xmta 'Euphrasia Thu Apr 27 17:56:23 2017' ./.ENCRYPT
4973 printf 'behave:s/mime:encrypt+sign: '
4976 -Ssmime-force-encryption \
4977 -Ssmime-encrypt-recei@ver.com=./.tpair.pem \
4979 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
4980 -Ssmime-sign -Sfrom=test@localhost \
4981 -s 'S/MIME test' recei@ver.com
4982 if [ $? -eq 0 ]; then
4986 printf 'error: encrypt+sign failed\n'
4989 ${sed} -e '/^$/,$d' < ./.ENCRYPT > "${MBOX}"
4990 check behave:s/mime:encrypt+sign:checksum - "${MBOX}" '1937410597 327'
4992 printf 'behave:s/mime:decrypt+verify: '
4993 printf 'decrypt ./.DECRYPT\nfi ./.DECRYPT\nverify\nx\n' |
4995 -Ssmime-force-encryption \
4996 -Ssmime-encrypt-recei@ver.com=./.tpair.pem \
4998 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
4999 -Ssmime-sign -Sfrom=test@localhost \
5001 -f ./.ENCRYPT >>${ERR} 2>&1
5002 if [ $? -eq 0 ]; then
5011 /^Content-Description: /{ skip = 2; print; next }
5012 /^$/{ if(skip) --skip }
5015 < ./.DECRYPT > "${MBOX}"
5016 check behave:s/mime:decrypt+verify:checksum - "${MBOX}" '1720739247 931'
5018 printf 'behave:s/mime:decrypt+verify:disproof-1: '
5019 if (openssl smime -decrypt -inkey ./.tkey.pem -in ./.ENCRYPT |
5020 openssl smime -verify -CAfile ./.tcert.pem) >>${ERR} 2>&1; then
5027 printf "behave
:s
/mime
:encrypt
: "
5029 echo bla | ${MAILX} ${ARGS} \
5030 -Ssmime-force-encryption \
5031 -Ssmime-encrypt-recei@ver.com=./.tpair.pem \
5033 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
5034 -Sfrom=test@localhost \
5035 -s 'S/MIME test' recei@ver.com
5036 if [ $? -eq 0 ]; then
5043 # Same as behave:s/mime:encrypt+sign:checksum above
5044 ${sed} -e '/^$/,$d' < ./.ENCRYPT > "${MBOX}"
5045 check behave:s/mime:encrypt:checksum - "${MBOX}" '1937410597 327'
5048 printf 'decrypt ./.DECRYPT\nx\n' | ${MAILX} ${ARGS} \
5049 -Ssmime-force-encryption \
5050 -Ssmime-encrypt-recei@ver.com=./.tpair.pem \
5052 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
5053 -Sfrom=test@localhost \
5055 -f ./.ENCRYPT >>${ERR} 2>&1
5056 check behave:s/mime:decrypt 0 ".
/.DECRYPT
" '2624716890 422'
5058 printf 'behave:s/mime:decrypt:disproof-1: '
5059 if openssl smime -decrypt -inkey ./.tkey.pem \
5060 -in ./.ENCRYPT >>${ERR} 2>&1; then
5071 # xxx Note: t_content() was the first test (series) written. Today many
5072 # xxx aspects are (better) covered by other tests above, some are not.
5073 # xxx At some future date and time, convert the last remains not covered
5074 # xxx elsewhere to a real t_behave_* test and drop t_content()
5078 # Test for [260e19d] (Juergen Daubert)
5079 echo body | ${MAILX} ${ARGS} "${MBOX}"
5080 check content
:004 0 "${MBOX}" '2917662811 98'
5082 # "Test for" [d6f316a] (Gavin Troy)
5084 printf "m ${MBOX}\n~s subject1\nEmail body\n~.\nfi ${MBOX}\np\nx\n" |
5085 ${MAILX} ${ARGS} ${ADDARG_UNI} -Spipe-text/plain="@* ${cat}" > "${BODY}"
5086 check content:006 0 "${MBOX}" '2099098650 122'
5087 check content:006-1 - "${BODY}" '794542938 174'
5089 # "Test
for" [c299c45] (Peter Hofmann) TODO shouldn't end up QP-encoded?
5092 for(i = 0; i < 10000; ++i)
5094 #printf "\xF0\x90\x87\x90"
5095 }' | ${MAILX} ${ARGS} ${ADDARG_UNI} -s TestSubject "${MBOX}"
5096 check content
:007 0 "${MBOX}" '534262374 61816'
5102 # MIME encoding (QP) stress message subject
5103 printf 'Äbrä Kä?dä=brö Fü?di=bus? '\
5104 'adadaddsssssssddddddddddddddddddddd'\
5105 'ddddddddddddddddddddddddddddddddddd'\
5106 'ddddddddddddddddddddddddddddddddddd'\
5107 'dddddddddddddddddddd Hallelulja? Od'\
5108 'er?? eeeeeeeeeeeeeeeeeeeeeeeeeeeeee'\
5109 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee'\
5110 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee f'\
5111 'fffffffffffffffffffffffffffffffffff'\
5112 'fffffffffffffffffffff ggggggggggggg'\
5113 'ggggggggggggggggggggggggggggggggggg'\
5114 'ggggggggggggggggggggggggggggggggggg'\
5115 'ggggggggggggggggggggggggggggggggggg'\
5120 # MIME encoding (QP) stress message body
5122 'Ich bin eine DÖS-Datäi mit sehr langen Zeilen und auch '\
5123 'sonst bin ich ganz schön am Schleudern, da kannste denke '\
5124 "wasde willst, gelle, gelle, gelle, gelle, gelle.\r\n"\
5125 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst \r\n"\
5126 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 1\r\n"\
5127 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 12\r\n"\
5128 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 123\r\n"\
5129 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 1234\r\n"\
5130 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 12345\r\n"\
5131 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 123456\r\n"\
5132 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 1234567\r\n"\
5133 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 12345678\r\n"\
5134 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 123456789\r\n"\
5135 "Unn ausserdem habe ich trailing SP/HT/SP/HT whitespace \r\n"\
5136 "Unn ausserdem habe ich trailing HT/SP/HT/SP whitespace \r\n"\
5137 "auf den zeilen vorher.\r\n"\
5138 "From am Zeilenbeginn und From der Mitte gibt es auch.\r\n"\
5140 "Die letzte Zeile war nur ein Punkt.\r\n"\
5142 "Das waren deren zwei.\r\n"\
5144 "Die letzte Zeile war ein Leerschritt.\n"\
5145 "=VIER = EQUAL SIGNS=ON A LINE=\r\n"\
5148 "Die letzte Zeile war nur ein Punkt, mit Unix Zeilenende.\n"\
5150 "Das waren deren zwei. ditto.\n"\
5152 "Unn ausseerdem habe ich trailing SP/HT/SP/HT whitespace \n"\
5153 "Unn ausseerdem habe ich trailing HT/SP/HT/SP whitespace \n"\
5154 "auf den zeilen vorher.\n"\
5156 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.\n"\
5157 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.1"\
5159 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
5161 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
5163 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
5165 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
5167 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
5169 "QP am Zeilenende über soft-nl hinweg\n"\
5170 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende."\
5172 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende."\
5174 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende."\
5176 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende."\
5178 "=VIER = EQUAL SIGNS=ON A LINE=\n"\
5180 "Die letzte Zeile war ein Leerschritt.\n"\
5185 # if have_feat devel; then
5186 # ARGS="${ARGS} -Smemdebug"
5190 if [ -n "${UTF8_LOCALE}" ]; then
5191 printf 'Using Unicode locale %s\n' "${UTF8_LOCALE}"
5193 printf 'No Unicode locale found, disabling Unicode tests\n'
5201 # Test all configs TODO doesn't cover all *combinations*, stupid!
5205 ALWAYS = "OPT_AUTOCC=1 OPT_AMALGAMATION=1"
5206 NOTME["OPT_ALWAYS_UNICODE_LOCALE"] = 1
5207 NOTME["OPT_CROSS_BUILD"] = 1
5208 NOTME["OPT_AUTOCC"] = 1
5209 NOTME["OPT_AMALGAMATION"] = 1
5210 NOTME["OPT_DEBUG"] = 1
5211 NOTME["OPT_DEVEL"] = 1
5212 NOTME["OPT_ASAN_ADDRESS"] = 1
5213 NOTME["OPT_ASAN_MEMORY"] = 1
5214 NOTME["OPT_FORCED_STACKPROT"] = 1
5215 NOTME["OPT_NOMEMDBG"] = 1
5216 NOTME["OPT_NYD2"] = 1
5221 MULCHOICE["OPT_IDNA"] = "VAL_IDNA"
5222 MULVALS["VAL_IDNA"] = 1
5224 #VALKEYS[0] = "VAL_RANDOM"
5225 VALVALS["VAL_RANDOM"] = 1
5228 /^[[:space:]]*OPT_/{
5229 sub(/^[[:space:]]*/, "")
5230 # This bails for UnixWare 7.1.4 awk(1), but preceeding = with \
5231 # does not seem to be a compliant escape for =
5233 $1 = substr($1, 1, index($1, "=") - 1)
5235 OPTVALS[OPTNO++] = $1
5238 /^[[:space:]]*VAL_/{
5239 sub(/^[[:space:]]*/, "")
5240 val = substr($0, index($0, "=") + 1)
5242 val = substr(val, 2)
5243 val = substr(val, 1, length(val) - 1)
5245 $1 = substr($1, 1, index($1, "=") - 1)
5248 else if(VALVALS[$1]){
5249 VALKEYS[VALNO++] = $1
5254 function onepass(addons){
5255 a_onepass__worker(addons, "1", "0")
5256 a_onepass__worker(addons, "0", "1")
5258 function a_onepass__worker(addons, b0, b1){
5259 # Doing this completely sequentially and not doing make distclean in
5260 # between runs should effectively result in lesser compilations.
5261 # It is completely dumb nonetheless... TODO
5262 for(ono = 0; ono < OPTNO; ++ono){
5264 for(i = 0; i < ono; ++i){
5265 myconf = myconf " " OPTVALS[i] "=" b0 " "
5267 j = MULCHOICE[OPTVALS[i]]
5272 myconf = myconf " " MULCHOICE[OPTVALS[i]] "=any "
5276 for(i = ono; i < OPTNO; ++i){
5277 myconf = myconf " " OPTVALS[i] "=" b1 " "
5279 j = MULCHOICE[OPTVALS[i]]
5284 myconf = myconf " " MULCHOICE[OPTVALS[i]] "=any "
5290 myconf = VALKEYS[i] "=any " myconf
5292 myconf = myconf " " ALWAYS " " addons
5297 i = split(MULVALS[mula], ia)
5301 print mula "=\"" j "\" " myconf
5307 # We cannot test NULL because of missing UI strings, which will end
5308 # up with different checksums
5309 print "CONFIG=NULLI OPT_AUTOCC=1"
5311 j = split(VALVALS[VALKEYS[i]], ia)
5315 print VALKEYS[i] "=\"" k "\" CONFIG=NULLI OPT_AUTOCC=1"
5318 print "CONFIG=MINIMAL OPT_AUTOCC=1"
5319 print "CONFIG=NETSEND OPT_AUTOCC=1"
5320 print "CONFIG=MAXIMAL OPT_AUTOCC=1"
5322 j = split(VALVALS[VALKEYS[i]], ia)
5326 print VALKEYS[i] "=\"" k "\" CONFIG=MAXIMAL OPT_AUTOCC=1"
5329 print "CONFIG=DEVEL OPT_AUTOCC=1"
5330 print "CONFIG=ODEVEL OPT_AUTOCC=1"
5332 onepass("OPT_DEBUG=1")
5335 ' |
while read c
; do
5336 [ -f mk-config.h
] && ${cp} mk-config.h .ccac.h
5337 printf "\n\n##########\n$c\n"
5338 printf "\n\n##########\n$c\n" >&2
5339 ${SHELL} -c "cd .. && ${MAKE} ${c} config
"
5340 if [ -f .ccac.h ] && ${cmp} mk-config.h .ccac.h; then
5341 printf 'Skipping after config, nothing changed\n'
5342 printf 'Skipping after config, nothing changed\n' >&2
5345 ${SHELL} -c "cd ..
/ && ${MAKE} build
test"
5348 cd .. && ${MAKE} distclean
5351 [ -n "${ERR}" ] && echo > ${ERR}
5352 if [ -z "${CHECK_ONLY}${MAE_TEST}" ]; then
5354 elif [ -z "${MAE_TEST}" ] || [ ${#} -eq 0 ]; then
5357 while [ ${#} -gt 0 ]; do
5363 [ ${ESTAT} -eq 0 ] && echo Ok || echo >&2 'Errors occurred'