cc-test.sh: add some `call' and `xcall' tests with exit/err passing
[s-mailx.git] / cc-test.sh
blob78821a726ccf3ae4aa84ada720201ab52584dbdc
1 #!/bin/mksh -
2 #@ Usage: ./cc-test.sh [--check-only [s-nail-binary]]
4 ARGS='-:/ -# -Sdotlock-ignore-error -Sencoding=quoted-printable -Sstealthmua'
5 ARGS="${ARGS}"' -Snosave -Sexpandaddr=restrict'
6 ARGS="${ARGS}"' -Slog-prefix=classico:'
7 CONF=./make.rc
8 BODY=./.cc-body.txt
9 MBOX=./.cc-test.mbox
10 MAIL=/dev/null
11 #UTF8_LOCALE= autodetected unless set
13 if ( command -v command ) >/dev/null 2>&1; then :; else
14 command() {
15 shift
16 which "${@}"
20 MAKE="${MAKE:-`command -v make`}"
21 awk=${awk:-`command -v awk`}
22 cat=${cat:-`command -v cat`}
23 cksum=${cksum:-`command -v cksum`}
24 rm=${rm:-`command -v rm`}
25 sed=${sed:-`command -v sed`}
26 grep=${grep:-`command -v grep`}
28 ## -- >8 -- 8< -- ##
30 export SNAIL ARGS CONF BODY MBOX MAIL MAKE awk cat cksum rm sed grep
32 LC_ALL=C LANG=C ADDARG_UNI=-Sttycharset=UTF-8
33 TZ=UTC
34 # Wed Oct 2 01:50:07 UTC 1996
35 SOURCE_DATE_EPOCH=844221007
37 export LC_ALL LANG ADDARG_UNI TZ SOURCE_DATE_EPOCH
38 unset POSIXLY_CORRECT
40 # Problem: force $SHELL to be a real shell. It seems some testing environments
41 # use nologin(?), but we need a real shell for command execution
42 if { echo ${SHELL} | ${grep} nologin; } >/dev/null 2>&1; then
43 echo >&2 '$SHELL seems to be nologin, overwriting to /bin/sh!'
44 SHELL=/bin/sh
45 export SHELL
48 if [ -z "${UTF8_LOCALE}" ]; then
49 UTF8_LOCALE=
50 if command -v locale >/dev/null 2>&1; then
51 UTF8_LOCALE=`locale -a | { m=
52 while read n; do
53 if { echo ${n} | ${grep} -i 'utf-\{0,1\}8'; } >/dev/null 2>&1; then
54 m=${n}
55 if { echo ${n} | ${grep} -e POSIX -e en_EN -e en_US; }; then
56 exit 0
59 m=${n}
60 done
61 echo ${m}
66 ESTAT=0
68 usage() {
69 echo >&2 "Usage: ./cc-test.sh [--check-only [s-nail-binary]]"
70 exit 1
73 CHECK_ONLY=
74 [ ${#} -gt 0 ] && {
75 [ "${1}" = --check-only ] || usage
76 [ ${#} -gt 2 ] && usage
77 [ ${#} -eq 2 ] && SNAIL="${2}"
78 [ -x "${SNAIL}" ] || usage
79 CHECK_ONLY=1
82 TRAP_EXIT_ADDONS=
83 trap "${rm} -rf \"${BODY}\" \"${MBOX}\" \${TRAP_EXIT_ADDONS}" EXIT
84 trap "exit 1" HUP INT TERM
86 # cc_all_configs()
87 # Test all configs TODO doesn't cover all *combinations*, stupid!
88 cc_all_configs() {
89 < ${CONF} ${awk} '
90 BEGIN {
91 NOTME["OPT_AUTOCC"] = 1
92 NOTME["OPT_DEBUG"] = 1
93 NOTME["OPT_DEVEL"] = 1
94 NOTME["OPT_NOEXTMD5"] = 1
95 NOTME["OPT_NOMEMDBG"] = 1
96 NOTME["OPT_NYD2"] = 1
97 i = 0
99 /^[[:space:]]*OPT_/ {
100 sub(/^[[:space:]]*/, "")
101 # This bails for UnixWare 7.1.4 awk(1), but preceeding = with \
102 # does not seem to be a compliant escape for =
103 #sub(/=.*$/, "")
104 $1 = substr($1, 1, index($1, "=") - 1)
105 if (NOTME[$1])
106 next
107 data[i++] = $1
109 END {
110 # Doing this completely sequentially and not doing make distclean in
111 # between runs should effectively result in lesser compilations.
112 # It is completely dumb nonetheless... TODO
113 for (j = 1; j < i; ++j) {
114 for (k = 1; k < j; ++k)
115 printf data[k] "=1 "
116 for (k = j; k < i; ++k)
117 printf data[k] "=0 "
118 printf "OPT_AUTOCC=1\n"
120 for (j = 1; j < i; ++j) {
121 for (k = 1; k < j; ++k)
122 printf data[k] "=0 "
123 for (k = j; k < i; ++k)
124 printf data[k] "=1 "
125 printf "OPT_AUTOCC=1\n"
127 # With debug
128 for (j = 1; j < i; ++j) {
129 for (k = 1; k < j; ++k)
130 printf data[k] "=1 "
131 for (k = j; k < i; ++k)
132 printf data[k] "=0 "
133 printf "OPT_AUTOCC=1\n"
134 printf "OPT_DEBUG=1\n"
136 for (j = 1; j < i; ++j) {
137 for (k = 1; k < j; ++k)
138 printf data[k] "=0 "
139 for (k = j; k < i; ++k)
140 printf data[k] "=1 "
141 printf "OPT_AUTOCC=1\n"
142 printf "OPT_DEBUG=1\n"
145 printf "CONFIG=NULL OPT_AUTOCC=0\n"
146 printf "CONFIG=NULL OPT_AUTOCC=1\n"
147 printf "CONFIG=NULLI OPT_AUTOCC=0\n"
148 printf "CONFIG=NULLI OPT_AUTOCC=1\n"
149 printf "CONFIG=MINIMAL OPT_AUTOCC=0\n"
150 printf "CONFIG=MINIMAL OPT_AUTOCC=1\n"
151 printf "CONFIG=MEDIUM OPT_AUTOCC=0\n"
152 printf "CONFIG=MEDIUM OPT_AUTOCC=1\n"
153 printf "CONFIG=NETSEND OPT_AUTOCC=0\n"
154 printf "CONFIG=NETSEND OPT_AUTOCC=1\n"
155 printf "CONFIG=MAXIMAL OPT_AUTOCC=0\n"
156 printf "CONFIG=MAXIMAL OPT_AUTOCC=1\n"
157 printf "CONFIG=DEVEL OPT_AUTOCC=0\n"
158 printf "CONFIG=DEVEL OPT_AUTOCC=1\n"
159 printf "CONFIG=ODEVEL OPT_AUTOCC=0\n"
160 printf "CONFIG=ODEVEL OPT_AUTOCC=1\n"
162 ' | while read c; do
163 printf "\n\n##########\n$c\n"
164 printf "\n\n##########\n$c\n" >&2
165 sh -c "${MAKE} ${c}"
166 t_all
167 done
168 ${MAKE} distclean
171 # cksum_test()
172 # Read mailbox $2, strip non-constant headers and MIME boundaries, query the
173 # cksum(1) of the resulting data and compare against the checksum $3
174 cksum_test() {
175 tid=${1} f=${2} s=${3}
176 printf "${tid}: "
177 csum="`${sed} -e '/^From /d' \
178 -e '/^ boundary=/d' -e '/^--=-=/d' < \"${f}\" \
179 -e '/^\[-- Message/d' | ${cksum}`";
180 if [ "${csum}" = "${s}" ]; then
181 printf 'ok\n'
182 else
183 ESTAT=1
184 printf 'error: checksum mismatch (got %s)\n' "${csum}"
188 have_feat() {
189 ( "${SNAIL}" ${ARGS} -X'echo $features' -Xx | ${grep} +${1} ) >/dev/null 2>&1
192 # t_behave()
193 # Basic (easily testable) behaviour tests
194 t_behave() {
195 t_behave_X_opt_input_command_stack
196 t_behave_wysh
197 t_behave_input_inject_semicolon_seq
198 t_behave_commandalias
199 t_behave_ifelse
200 t_behave_localopts
201 t_behave_macro_param_shift
202 t_behave_addrcodec
203 t_behave_vexpr
204 t_behave_call_ret
205 t_behave_xcall
207 # FIXME t_behave_alias
209 # FIXME t_behave_mlist
211 have_feat smime && t_behave_smime
213 t_behave_e_H_L_opts
214 t_behave_compose_hooks
217 t_behave_X_opt_input_command_stack() {
218 ${cat} <<- '__EOT' > "${BODY}"
219 echo 1
220 define mac0 {
221 echo mac0-1 via1 $0
223 call mac0
224 echo 2
225 source '\
226 echo "define mac1 {";\
227 echo " echo mac1-1 via1 \$0";\
228 echo " call mac0";\
229 echo " echo mac1-2";\
230 echo " call mac2";\
231 echo " echo mac1-3";\
232 echo "}";\
233 echo "echo 1-1";\
234 echo "define mac2 {";\
235 echo " echo mac2-1 via1 \$0";\
236 echo " call mac0";\
237 echo " echo mac2-2";\
238 echo "}";\
239 echo "echo 1-2";\
240 echo "call mac1";\
241 echo "echo 1-3";\
242 echo "source \"\
243 echo echo 1-1-1 via1 \$0;\
244 echo call mac0;\
245 echo echo 1-1-2;\
246 | \"";\
247 echo "echo 1-4";\
249 echo 3
250 call mac2
251 echo 4
252 undefine *
253 __EOT
255 # The -X option supports multiline arguments, and those can internally use
256 # reverse solidus newline escaping. And all -X options are joined...
257 APO=\'
258 < "${BODY}" "${SNAIL}" ${ARGS} \
259 -X 'e\' \
260 -X ' c\' \
261 -X ' h\' \
262 -X ' o \' \
263 -X 1 \
265 define mac0 {
266 echo mac0-1 via2 $0
268 call mac0
269 echo 2
272 source '${APO}'\
273 echo "define mac1 {";\
274 echo " echo mac1-1 via2 \$0";\
275 echo " call mac0";\
276 echo " echo mac1-2";\
277 echo " call mac2";\
278 echo " echo mac1-3";\
279 echo "}";\
280 echo "echo 1-1";\
281 echo "define mac2 {";\
282 echo " echo mac2-1 via2 \$0";\
283 echo " call mac0";\
284 echo " echo mac2-2";\
285 echo "}";\
286 echo "echo 1-2";\
287 echo "call mac1";\
288 echo "echo 1-3";\
289 echo "source \"\
290 echo echo 1-1-1 via2 \$0;\
291 echo call mac0;\
292 echo echo 1-1-2;\
293 | \"";\
294 echo "echo 1-4";\
295 | '${APO}'
296 echo 3
299 call mac2
300 echo 4
301 undefine *
302 ' > "${MBOX}" 2>/dev/null
304 #mac0-1 via2
306 #1-1
307 #1-2
308 #mac1-1 via2
309 #mac0-1 via2 mac1
310 #mac1-2
311 #mac2-1 via2 mac1
312 #mac0-1 via2 mac2
313 #mac2-2
314 #mac1-3
315 #1-3
316 #1-1-1 via2
317 #mac0-1 via2
318 #1-1-2
319 #1-4
321 #mac2-1 via2
322 #mac0-1 via2 mac2
323 #mac2-2
326 #mac0-1 via1
328 #1-1
329 #1-2
330 #mac1-1 via1
331 #mac0-1 via1 mac1
332 #mac1-2
333 #mac2-1 via1 mac1
334 #mac0-1 via1 mac2
335 #mac2-2
336 #mac1-3
337 #1-3
338 #1-1-1 via1
339 #mac0-1 via1
340 #1-1-2
341 #1-4
343 #mac2-1 via1
344 #mac0-1 via1 mac2
345 #mac2-2
347 cksum_test behave:x_opt_input_command_stack "${MBOX}" '1391275936 378'
350 t_behave_wysh() {
351 ${cat} <<- '__EOT' > "${BODY}"
353 echo abcd
354 echo a'b'c'd'
355 echo a"b"c"d"
356 echo a$'b'c$'d'
357 echo 'abcd'
358 echo "abcd"
359 echo $'abcd'
360 echo a\ b\ c\ d
361 echo a 'b c' d
362 echo a "b c" d
363 echo a $'b c' d
365 echo 'a$`"\'
366 echo "a\$\`'\"\\"
367 echo $'a\$`\'\"\\'
368 echo $'a\$`\'"\\'
369 # DIET=CURD TIED=
370 echo 'a${DIET}b${TIED}c\${DIET}d\${TIED}e' # COMMENT
371 echo "a${DIET}b${TIED}c\${DIET}d\${TIED}e"
372 echo $'a${DIET}b${TIED}c\${DIET}d\${TIED}e'
374 echo a$'\101\0101\x41\u0041\u41\U00000041\U41'c
375 echo a$'\u0041\u41\u0C1\U00000041\U41'c
376 echo a$'\377'c
377 echo a$'\0377'c
378 echo a$'\400'c
379 echo a$'\0400'c
380 echo a$'\U1100001'c
382 echo a$'b\0c'd
383 echo a$'b\00c'de
384 echo a$'b\000c'df
385 echo a$'b\0000c'dg
386 echo a$'b\x0c'dh
387 echo a$'b\x00c'di
388 echo a$'b\u0'dj
389 echo a$'b\u00'dk
390 echo a$'b\u000'dl
391 echo a$'b\u0000'dm
392 echo a$'b\U0'dn
393 echo a$'b\U00'do
394 echo a$'b\U000'dp
395 echo a$'b\U0000'dq
396 echo a$'b\U00000'dr
397 echo a$'b\U000000'ds
398 echo a$'b\U0000000'dt
399 echo a$'b\U00000000'du
401 echo a$'\cI'b
402 echo a$'\011'b
403 echo a$'\x9'b
404 echo a$'\u9'b
405 echo a$'\U9'b
406 echo a$'\c@'b c d
407 __EOT
409 if [ -z "${UTF8_LOCALE}" ]; then
410 echo 'Skip behave:wysh_unicode, no UTF8_LOCALE'
411 else
412 < "${BODY}" DIET=CURD TIED= \
413 LC_ALL=${UTF8_LOCALE} "${SNAIL}" ${ARGS} 2>/dev/null > "${MBOX}"
414 #abcd
415 #abcd
416 #abcd
417 #abcd
418 #abcd
419 #abcd
420 #abcd
421 #a b c d
422 #a b c d
423 #a b c d
424 #a b c d
425 #a$`"\
426 #a$`'"\
427 #a$`'"\
428 #a$`'"\
429 #a${DIET}b${TIED}c\${DIET}d\${TIED}e
430 #aCURDbc${DIET}d${TIED}e
431 #a${DIET}b${TIED}cCURDde
432 #aAAAAAAAc
433 #aAAÁAAc
434 #aÿc
435 #aÿc
436 #abd
437 #abde
438 #abdf
439 #abdg
440 #ab\fdh
441 #abdi
442 #abdj
443 #abdk
444 #abdl
445 #abdm
446 #abdn
447 #abdo
448 #abdp
449 #abdq
450 #abdr
451 #abds
452 #abdt
453 #abdu
454 #a b
455 #a b
456 #a b
457 #a b
458 #a b
460 cksum_test behave:wysh_unicode "${MBOX}" '475805847 317'
463 < "${BODY}" DIET=CURD TIED= "${SNAIL}" ${ARGS} > "${MBOX}" 2>/dev/null
464 #abcd
465 #abcd
466 #abcd
467 #abcd
468 #abcd
469 #abcd
470 #abcd
471 #a b c d
472 #a b c d
473 #a b c d
474 #a b c d
475 #a$`"\
476 #a$`'"\
477 #a$`'"\
478 #a$`'"\
479 #a${DIET}b${TIED}c\${DIET}d\${TIED}e
480 #aCURDbc${DIET}d${TIED}e
481 #a${DIET}b${TIED}cCURDde
482 #aAAAAAAAc
483 #aAA\u0C1AAc
484 #aÿc
485 #aÿc
486 #abd
487 #abde
488 #abdf
489 #abdg
490 #ab\fdh
491 #abdi
492 #abdj
493 #abdk
494 #abdl
495 #abdm
496 #abdn
497 #abdo
498 #abdp
499 #abdq
500 #abdr
501 #abds
502 #abdt
503 #abdu
504 #a b
505 #a b
506 #a b
507 #a b
508 #a b
510 cksum_test behave:wysh_c "${MBOX}" '1473887148 321'
513 t_behave_input_inject_semicolon_seq() {
514 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} > "${MBOX}"
515 define mydeepmac {
516 echon '(mydeepmac)';
518 define mymac {
519 echon this_is_mymac;call mydeepmac;echon ';';
521 echon one';';~mymac;echon two";";call mymac;echo three$';';
522 define mymac {
523 echon this_is_mymac;call mydeepmac;echon ,TOO'!;';
525 echon one';';~mymac;echon two";";call mymac;echo three$';';
526 __EOT
527 #one;this_is_mymac(mydeepmac);two;this_is_mymac(mydeepmac);three;
528 #one;this_is_mymac(mydeepmac),TOO!;two;this_is_mymac(mydeepmac),TOO!;three;
529 cksum_test behave:input_inject_semicolon_seq "${MBOX}" '512117110 140'
532 t_behave_commandalias() {
533 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} > "${MBOX}"
534 commandalias echo echo hoho
535 echo stop.
536 commandalias X Xx
537 commandalias Xx XxX
538 commandalias XxX XxXx
539 commandalias XxXx XxXxX
540 commandalias XxXxX XxXxXx
541 commandalias XxXxXx echo huhu
542 commandalias XxXxXxX echo huhu
544 commandalias XxXxXx XxXxXxX
546 uncommandalias echo
547 commandalias XxXxXx echo huhu
549 __EOT
550 #hoho stop.
551 #hoho huhu
552 #huhu
553 #huhu
554 cksum_test behave:commandalias "${MBOX}" '3694143612 31'
557 t_behave_ifelse() {
558 # Nestable conditions test
559 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} > "${MBOX}"
560 if 0
561 echo 1.err
562 else
563 echo 1.ok
564 endif
565 if 1
566 echo 2.ok
567 else
568 echo 2.err
569 endif
570 if $dietcurd
571 echo 3.err
572 else
573 echo 3.ok
574 endif
575 set dietcurd=yoho
576 if $dietcurd
577 echo 4.ok
578 else
579 echo 4.err
580 endif
581 if $dietcurd == 'yoho'
582 echo 5.ok
583 else
584 echo 5.err
585 endif
586 if $dietcurd != 'yoho'
587 echo 6.err
588 else
589 echo 6.ok
590 endif
591 # Nesting
592 if faLse
593 echo 7.err1
594 if tRue
595 echo 7.err2
596 if yEs
597 echo 7.err3
598 else
599 echo 7.err4
600 endif
601 echo 7.err5
602 endif
603 echo 7.err6
604 else
605 echo 7.ok7
606 if YeS
607 echo 7.ok8
608 if No
609 echo 7.err9
610 else
611 echo 7.ok9
612 endif
613 echo 7.ok10
614 else
615 echo 7.err11
616 if yeS
617 echo 7.err12
618 else
619 echo 7.err13
620 endif
621 endif
622 echo 7.ok14
623 endif
624 if r
625 echo 8.ok1
626 if R
627 echo 8.ok2
628 else
629 echo 8.err2
630 endif
631 echo 8.ok3
632 else
633 echo 8.err1
634 endif
635 if s
636 echo 9.err1
637 else
638 echo 9.ok1
639 if S
640 echo 9.err2
641 else
642 echo 9.ok2
643 endif
644 echo 9.ok3
645 endif
646 # `elif'
647 if $dietcurd == 'yohu'
648 echo 10.err1
649 elif $dietcurd == 'yoha'
650 echo 10.err2
651 elif $dietcurd == 'yohe'
652 echo 10.err3
653 elif $dietcurd == 'yoho'
654 echo 10.ok1
655 if $dietcurd == 'yohu'
656 echo 10.err4
657 elif $dietcurd == 'yoha'
658 echo 10.err5
659 elif $dietcurd == 'yohe'
660 echo 10.err6
661 elif $dietcurd == 'yoho'
662 echo 10.ok2
663 if $dietcurd == 'yohu'
664 echo 10.err7
665 elif $dietcurd == 'yoha'
666 echo 10.err8
667 elif $dietcurd == 'yohe'
668 echo 10.err9
669 elif $dietcurd == 'yoho'
670 echo 10.ok3
671 else
672 echo 10.err10
673 endif
674 else
675 echo 10.err11
676 endif
677 else
678 echo 10.err12
679 endif
680 # integer conversion, <..>..
681 set dietcurd=10
682 if $dietcurd -lt 11
683 echo 11.ok1
684 if $dietcurd -gt 9
685 echo 11.ok2
686 else
687 echo 11.err2
688 endif
689 if $dietcurd -eq 10
690 echo 11.ok3
691 else
692 echo 11.err3
693 endif
694 if $dietcurd -ge 10
695 echo 11.ok4
696 else
697 echo 11.err4
698 endif
699 if $dietcurd -le 10
700 echo 11.ok5
701 else
702 echo 11.err5
703 endif
704 if $dietcurd -ge 11
705 echo 11.err6
706 else
707 echo 11.ok6
708 endif
709 if $dietcurd -le 9
710 echo 11.err7
711 else
712 echo 11.ok7
713 endif
714 else
715 echo 11.err1
716 endif
717 set dietcurd=Abc
718 if $dietcurd < aBd
719 echo 12.ok1
720 if $dietcurd > abB
721 echo 12.ok2
722 else
723 echo 12.err2
724 endif
725 if $dietcurd == aBC
726 echo 12.ok3
727 else
728 echo 12.err3
729 endif
730 if $dietcurd >= AbC
731 echo 12.ok4
732 else
733 echo 12.err4
734 endif
735 if $dietcurd <= ABc
736 echo 12.ok5
737 else
738 echo 12.err5
739 endif
740 if $dietcurd >= abd
741 echo 12.err6
742 else
743 echo 12.ok6
744 endif
745 if $dietcurd <= abb
746 echo 12.err7
747 else
748 echo 12.ok7
749 endif
750 else
751 echo 12.err1
752 endif
753 if $dietcurd =@ aB
754 echo 13.ok
755 else
756 echo 13.err
757 endif
758 if $dietcurd =@ bC
759 echo 14.ok
760 else
761 echo 14.err
762 endif
763 if $dietcurd !@ aB
764 echo 15.err
765 else
766 echo 15.ok
767 endif
768 if $dietcurd !@ bC
769 echo 15.err
770 else
771 echo 15.ok
772 endif
773 if $dietcurd =@ Cd
774 echo 16.err
775 else
776 echo 16.ok
777 endif
778 if $dietcurd !@ Cd
779 echo 17.ok
780 else
781 echo 17.err
782 endif
783 set diet=abc curd=abc
784 if $diet == $curd
785 echo 18.ok
786 else
787 echo 18.err
788 endif
789 set diet=abc curd=abcd
790 if $diet != $curd
791 echo 19.ok
792 else
793 echo 19.err
794 endif
795 # 1. Shitty grouping capabilities as of today
796 unset diet curd ndefined
797 if [ [ false ] || [ false ] || [ true ] ] && [ [ false ] || [ true ] ] && \
798 [ yes ]
799 echo 20.ok
800 else
801 echo 20.err
802 endif
803 if [ [ [ [ 0 ] || [ 1 ] ] && [ [ 1 ] || [ 0 ] ] ] && [ 1 ] ] && [ yes ]
804 echo 21.ok
805 else
806 echo 21.err
807 endif
808 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] ]
809 echo 22.ok
810 else
811 echo 22.err
812 endif
813 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] ]
814 echo 23.ok
815 else
816 echo 23.err
817 endif
818 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] || [ 1 ] ] && [ no ]
819 echo 24.err
820 else
821 echo 24.ok
822 endif
823 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] || [ 1 ] ] \
824 && [ no ] || [ yes ]
825 echo 25.ok
826 else
827 echo 25.err
828 endif
829 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 1 ] ]
830 echo 26.ok
831 else
832 echo 26.err
833 endif
834 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 0 ] ]
835 echo 27.err
836 else
837 echo 27.ok
838 endif
839 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 0 ] ] && [ 1 ] ] ] && [ 1 ] ]
840 echo 28.err
841 else
842 echo 28.ok
843 endif
844 if [ [ [ [ [ [ [ 0 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 1 ] ]
845 echo 29.err
846 else
847 echo 29.ok
848 endif
849 if [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] && [ 0 ]
850 echo 30.err
851 else
852 echo 30.ok
853 endif
854 if [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] && [ 1 ]
855 echo 31.ok
856 else
857 echo 31.err
858 endif
859 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ]
860 echo 32.err
861 else
862 echo 32.ok
863 endif
864 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 1 ]
865 echo 33.ok
866 else
867 echo 33.err
868 endif
869 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ] || [ 1 ] && [ 0 ]
870 echo 34.err
871 else
872 echo 34.ok
873 endif
874 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ] || [ 1 ] && [ 1 ]
875 echo 35.ok
876 else
877 echo 35.err
878 endif
879 set diet=yo curd=ho
880 if [ [ $diet == 'yo' ] && [ $curd == 'ho' ] ] && [ $ndefined ]
881 echo 36.err
882 else
883 echo 36.ok
884 endif
885 set ndefined
886 if [ [ $diet == 'yo' ] && [ $curd == 'ho' ] ] && [ $ndefined ]
887 echo 37.ok
888 else
889 echo 37.err
890 endif
891 # 2. Shitty grouping capabilities as of today
892 unset diet curd ndefined
893 if [ false || false || true ] && [ false || true ] && yes
894 echo 40.ok
895 else
896 echo 40.err
897 endif
898 if [ [ [ 0 || 1 ] && [ 1 || 0 ] ] && 1 ] && [ yes ]
899 echo 41.ok
900 else
901 echo 41.err
902 endif
903 if [ 1 || 0 || 0 || 0 ]
904 echo 42.ok
905 else
906 echo 42.err
907 endif
908 if [ 1 || 0 || 0 || 0 || [ 1 ] ]
909 echo 43.ok
910 else
911 echo 43.err
912 endif
913 if [ 1 || 0 || 0 || 0 || [ 1 ] || 1 ] && no
914 echo 44.err
915 else
916 echo 44.ok
917 endif
918 if [ 1 || 0 || 0 || 0 || 1 || [ 1 ] ] && no || [ yes ]
919 echo 45.ok
920 else
921 echo 45.err
922 endif
923 if [ [ [ [ [ [ 1 ] && 1 ] && 1 ] && 1 ] ] && [ 1 ] ]
924 echo 46.ok
925 else
926 echo 46.err
927 endif
928 if [ [ [ [ [ [ 1 ] && 1 ] && 1 ] && [ 1 ] ] ] && 0 ]
929 echo 47.err
930 else
931 echo 47.ok
932 endif
933 if [ [ [ [ [ [ [ 1 ] ] && 1 ] && 0 ] && [ 1 ] ] ] && 1 ]
934 echo 48.err
935 else
936 echo 48.ok
937 endif
938 if [ [ [ [ [ [ 0 ] && 1 ] && 1 ] && 1 ] ] && 1 ]
939 echo 49.err
940 else
941 echo 49.ok
942 endif
943 if 1 || 0 || 0 || 0 && 0
944 echo 50.err
945 else
946 echo 50.ok
947 endif
948 if 1 || 0 || 0 || 0 && 1
949 echo 51.ok
950 else
951 echo 51.err
952 endif
953 if 0 || 0 || 0 || 1 && 0
954 echo 52.err
955 else
956 echo 52.ok
957 endif
958 if 0 || 0 || 0 || 1 && 1
959 echo 53.ok
960 else
961 echo 53.err
962 endif
963 if 0 || 0 || 0 || 1 && 0 || 1 && 0
964 echo 54.err
965 else
966 echo 54.ok
967 endif
968 if 0 || 0 || 0 || 1 && 0 || 1 && 1
969 echo 55.ok
970 else
971 echo 55.err
972 endif
973 set diet=yo curd=ho
974 if [ $diet == 'yo' && $curd == 'ho' ] && $ndefined
975 echo 56.err
976 else
977 echo 56.ok
978 endif
979 if $diet == 'yo' && $curd == 'ho' && $ndefined
980 echo 57.err
981 else
982 echo 57.ok
983 endif
984 set ndefined
985 if [ $diet == 'yo' && $curd == 'ho' ] && $ndefined
986 echo 57.ok
987 else
988 echo 57.err
989 endif
990 if $diet == 'yo' && $curd == 'ho' && $ndefined
991 echo 58.ok
992 else
993 echo 58.err
994 endif
995 if [ [ [ [ [ [ $diet == 'yo' && $curd == 'ho' && $ndefined ] ] ] ] ] ]
996 echo 59.ok
997 else
998 echo 59.err
999 endif
1000 # Some more en-braced variables
1001 set diet=yo curd=ho
1002 if ${diet} == ${curd}
1003 echo 70.err
1004 else
1005 echo 70.ok
1006 endif
1007 if ${diet} != ${curd}
1008 echo 71.ok
1009 else
1010 echo 71.err
1011 endif
1012 if $diet == ${curd}
1013 echo 72.err
1014 else
1015 echo 72.ok
1016 endif
1017 if ${diet} == $curd
1018 echo 73.err
1019 else
1020 echo 73.ok
1021 endif
1022 # Unary !
1023 if ! 0 && ! ! 1 && ! ! ! ! 2 && 3
1024 echo 80.ok
1025 else
1026 echo 80.err
1027 endif
1028 if ! 0 && ! [ ! 1 ] && ! [ ! [ ! [ ! 2 ] ] ] && 3
1029 echo 81.ok
1030 else
1031 echo 81.err
1032 endif
1033 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
1034 echo 82.ok
1035 else
1036 echo 82.err
1037 endif
1038 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && ! 3
1039 echo 83.err
1040 else
1041 echo 83.ok
1042 endif
1043 if [ ! 0 ] && [ ! [ ! 1 ] ] && ! [ [ ! [ ! [ ! [ 2 ] ] ] ] ] && ! 3
1044 echo 84.err
1045 else
1046 echo 84.ok
1047 endif
1048 if [ ! 0 ] && ! [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
1049 echo 85.err
1050 else
1051 echo 85.ok
1052 endif
1053 if ! [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
1054 echo 86.err
1055 else
1056 echo 86.ok
1057 endif
1058 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] || 3
1059 echo 87.ok
1060 else
1061 echo 87.err
1062 endif
1063 if [ ! 0 ] && [ ! ! [ ! ! 1 ] ] && [ ! ! [ ! ! [ ! ! [ ! ! [ 2 ] ] ] ] ]
1064 echo 88.ok
1065 else
1066 echo 88.err
1067 endif
1068 # Unary !, odd
1069 if ! 0 && ! ! 1 && ! ! ! 0 && 3
1070 echo 90.ok
1071 else
1072 echo 90.err
1073 endif
1074 if ! 0 && ! [ ! 1 ] && ! [ ! [ ! [ 0 ] ] ] && 3
1075 echo 91.ok
1076 else
1077 echo 91.err
1078 endif
1079 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ [ 0 ] ] ] ] ] && 3
1080 echo 92.ok
1081 else
1082 echo 92.err
1083 endif
1084 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! ! [ ! [ ! 0 ] ] ] ] && ! 3
1085 echo 93.err
1086 else
1087 echo 93.ok
1088 endif
1089 if [ ! 0 ] && [ ! [ ! 1 ] ] && ! [ ! [ ! [ ! [ ! 0 ] ] ] ] && 3
1090 echo 94.ok
1091 else
1092 echo 94.err
1093 endif
1094 if [ ! 0 ] && ! [ ! [ ! 1 ] ] && [ ! ! [ ! [ ! [ ! [ 0 ] ] ] ] ] && 3
1095 echo 95.err
1096 else
1097 echo 95.ok
1098 endif
1099 if ! [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! ! 0 ] ] ] ] && 3
1100 echo 96.err
1101 else
1102 echo 96.ok
1103 endif
1104 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ ! 0 ] ] ] ] ] || 3
1105 echo 97.ok
1106 else
1107 echo 97.err
1108 endif
1109 if [ ! 0 ] && [ ! ! [ ! ! 1 ] ] && [ ! ! [ ! ! [ ! ! [ ! [ 0 ] ] ] ] ]
1110 echo 98.ok
1111 else
1112 echo 98.err
1113 endif
1114 __EOT
1115 cksum_test behave:if-normal "${MBOX}" '557629289 631'
1117 if have_feat regex; then
1118 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} > "${MBOX}"
1119 set dietcurd=yoho
1120 if $dietcurd =~ '^yo.*'
1121 echo 1.ok
1122 else
1123 echo 1.err
1124 endif
1125 if $dietcurd =~ '^yoho.+'
1126 echo 2.err
1127 else
1128 echo 2.ok
1129 endif
1130 if $dietcurd !~ '.*ho$'
1131 echo 3.err
1132 else
1133 echo 3.ok
1134 endif
1135 if $dietcurd !~ '.+yoho$'
1136 echo 4.ok
1137 else
1138 echo 4.err
1139 endif
1140 if [ $dietcurd !~ '.+yoho$' ]
1141 echo 5.ok
1142 else
1143 echo 5.err
1144 endif
1145 if ! [ $dietcurd =~ '.+yoho$' ]
1146 echo 6.ok
1147 else
1148 echo 6.err
1149 endif
1150 if ! ! [ $dietcurd !~ '.+yoho$' ]
1151 echo 7.ok
1152 else
1153 echo 7.err
1154 endif
1155 if ! [ ! [ $dietcurd !~ '.+yoho$' ] ]
1156 echo 8.ok
1157 else
1158 echo 8.err
1159 endif
1160 if [ ! [ ! [ $dietcurd !~ '.+yoho$' ] ] ]
1161 echo 9.ok
1162 else
1163 echo 9.err
1164 endif
1165 if ! [ ! [ ! [ $dietcurd !~ '.+yoho$' ] ] ]
1166 echo 10.err
1167 else
1168 echo 10.ok
1169 endif
1170 if ! ! ! $dietcurd !~ '.+yoho$'
1171 echo 11.err
1172 else
1173 echo 11.ok
1174 endif
1175 if ! ! ! $dietcurd =~ '.+yoho$'
1176 echo 12.ok
1177 else
1178 echo 12.err
1179 endif
1180 if ! [ ! ! [ ! [ $dietcurd !~ '.+yoho$' ] ] ]
1181 echo 13.ok
1182 else
1183 echo 13.err
1184 endif
1185 set diet=abc curd='^abc$'
1186 if $diet =~ $curd
1187 echo 14.ok
1188 else
1189 echo 14.err
1190 endif
1191 set diet=abc curd='^abcd$'
1192 if $diet !~ $curd
1193 echo 15.ok
1194 else
1195 echo 15.err
1196 endif
1197 __EOT
1198 cksum_test behave:if-regex "${MBOX}" '439960016 81'
1202 t_behave_localopts() {
1203 # Nestable conditions test
1204 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} > "${MBOX}"
1205 define t2 {
1206 echo in: t2
1207 set t2=t2
1208 echo $t2
1210 define t1 {
1211 echo in: t1
1212 set gv1=gv1
1213 localopts on
1214 set lv1=lv1 lv2=lv2
1215 set lv3=lv3
1216 call t2
1217 localopts off
1218 set gv2=gv2
1219 echo $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2
1221 define t0 {
1222 echo in: t0
1223 call t1
1224 echo $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2
1225 echo "$gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2"
1227 account trouble {
1228 echo in: trouble
1229 call t0
1231 call t0
1232 unset gv1 gv2
1233 account trouble
1234 echo active trouble: $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t3
1235 account null
1236 echo active null: $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t3
1237 __EOT
1238 #in: t0
1239 #in: t1
1240 #in: t2
1242 #gv1 lv1 lv2 lv3 gv2, t2
1243 #gv1 gv2,
1244 #gv1 gv2,
1245 #in: trouble
1246 #in: t0
1247 #in: t1
1248 #in: t2
1250 #gv1 lv1 lv2 lv3 gv2, t2
1251 #gv1 gv2,
1252 #gv1 gv2,
1253 #active trouble: gv1 gv2,
1254 #active null: ,
1255 cksum_test behave:localopts "${MBOX}" '1936527193 192'
1258 t_behave_macro_param_shift() {
1259 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} > "${MBOX}" 2>/dev/null
1260 define t2 {
1261 echo in: t2
1262 echo t2.0 has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1263 localopts on
1264 wysh set ignerr=$1
1265 shift
1266 localopts off
1267 echo t2.1 has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1268 if [ $# > 1 ] || [ $ignerr == '' ]
1269 shift 2
1270 else
1271 ignerr shift 2
1272 endif
1273 echo t2.2:$? has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1274 shift 0
1275 echo t2.3:$? has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1276 if [ $# > 0 ]
1277 shift
1278 endif
1279 echo t2.4:$? has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1281 define t1 {
1282 set errexit
1283 echo in: t1
1284 call t2 1 you get four args
1285 echo t1.1: $?';' ignerr ($ignerr) should not exist
1286 call t2 1 you get 'three args'
1287 echo t1.2: $?';' ignerr ($ignerr) should not exist
1288 call t2 1 you 'get two args'
1289 echo t1.3: $?';' ignerr ($ignerr) should not exist
1290 call t2 1 'you get one arg'
1291 echo t1.4: $?';' ignerr ($ignerr) should not exist
1292 ignerr call t2 '' 'you get one arg'
1293 echo t1.5: $?';' ignerr ($ignerr) should not exist
1295 call t1
1296 __EOT
1297 #in: t1
1298 #in: t2
1299 #t2.0 has 5/5 parameters: 1,you,get (1 you get four args) [1 you get four args]
1300 #t2.1 has 4/4 parameters: you,get,four (you get four args) [you get four args]
1301 #t2.2:0 has 2/2 parameters: four,args, (four args) [four args]
1302 #t2.3:0 has 2/2 parameters: four,args, (four args) [four args]
1303 #t2.4:0 has 1/1 parameters: args,, (args) [args]
1304 #t1.1: 0; ignerr () should not exist
1305 #in: t2
1306 #t2.0 has 4/4 parameters: 1,you,get (1 you get three args) [1 you get three args]
1307 #t2.1 has 3/3 parameters: you,get,three args (you get three args) [you get three args]
1308 #t2.2:0 has 1/1 parameters: three args,, (three args) [three args]
1309 #t2.3:0 has 1/1 parameters: three args,, (three args) [three args]
1310 #t2.4:0 has 0/0 parameters: ,, () []
1311 #t1.2: 0; ignerr () should not exist
1312 #in: t2
1313 #t2.0 has 3/3 parameters: 1,you,get two args (1 you get two args) [1 you get two args]
1314 #t2.1 has 2/2 parameters: you,get two args, (you get two args) [you get two args]
1315 #t2.2:0 has 0/0 parameters: ,, () []
1316 #t2.3:0 has 0/0 parameters: ,, () []
1317 #t2.4:0 has 0/0 parameters: ,, () []
1318 #t1.3: 0; ignerr () should not exist
1319 #in: t2
1320 #t2.0 has 2/2 parameters: 1,you get one arg, (1 you get one arg) [1 you get one arg]
1321 #t2.1 has 1/1 parameters: you get one arg,, (you get one arg) [you get one arg]
1322 #t2.2:0 has 1/1 parameters: you get one arg,, (you get one arg) [you get one arg]
1323 #t2.3:0 has 1/1 parameters: you get one arg,, (you get one arg) [you get one arg]
1324 #t2.4:0 has 0/0 parameters: ,, () []
1325 #t1.4: 0; ignerr () should not exist
1326 #in: t2
1327 #t2.0 has 2/2 parameters: ,you get one arg, ( you get one arg) [ you get one arg]
1328 #t2.1 has 1/1 parameters: you get one arg,, (you get one arg) [you get one arg]
1329 #t1.5: 1; ignerr () should not exist
1330 cksum_test behave:macro_param_shift "${MBOX}" '1402489146 1682'
1333 t_behave_addrcodec() {
1334 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} > "${MBOX}"
1335 vput addrcodec res e 1 <doog@def>
1336 echo $?/$^ERRNAME $res
1337 eval vput addrcodec res d $res
1338 echo $?/$^ERRNAME $res
1339 vput addrcodec res e 2 . <doog@def>
1340 echo $?/$^ERRNAME $res
1341 eval vput addrcodec res d $res
1342 echo $?/$^ERRNAME $res
1343 vput addrcodec res e 3 Sauer Dr. <doog@def>
1344 echo $?/$^ERRNAME $res
1345 eval vput addrcodec res d $res
1346 echo $?/$^ERRNAME $res
1347 vput addrcodec res e 3.50 Sauer (Ma) Dr. <doog@def>
1348 echo $?/$^ERRNAME $res
1349 eval vput addrcodec res d $res
1350 echo $?/$^ERRNAME $res
1351 vput addrcodec res e 3.51 Sauer (Ma) "Dr." <doog@def>
1352 echo $?/$^ERRNAME $res
1353 eval vput addrcodec res d $res
1354 echo $?/$^ERRNAME $res
1356 vput addrcodec res +e 4 Sauer (Ma) Dr. <doog@def>
1357 echo $?/$^ERRNAME $res
1358 eval vput addrcodec res d $res
1359 echo $?/$^ERRNAME $res
1360 vput addrcodec res +e 5 Sauer (Ma) Braten Dr. <doog@def>
1361 echo $?/$^ERRNAME $res
1362 eval vput addrcodec res d $res
1363 echo $?/$^ERRNAME $res
1364 vput addrcodec res +e 6 Sauer (Ma) Braten Dr. (Heu) <doog@def>
1365 echo $?/$^ERRNAME $res
1366 eval vput addrcodec res d $res
1367 echo $?/$^ERRNAME $res
1368 vput addrcodec res +e 7 Sauer (Ma) Braten Dr. (Heu) <doog@def> (bu)
1369 echo $?/$^ERRNAME $res
1370 eval vput addrcodec res d $res
1371 echo $?/$^ERRNAME $res
1372 vput addrcodec res +e 8 \
1373 Dr. Sauer (Ma) Braten Dr. (Heu) <doog@def> (bu) Boom. Boom
1374 echo $?/$^ERRNAME $res
1375 eval vput addrcodec res d $res
1376 echo $?/$^ERRNAME $res
1377 vput addrcodec res +e 9 Dr.Sauer(Ma)Braten Dr. (Heu) <doog@def>
1378 echo $?/$^ERRNAME $res
1379 eval vput addrcodec res d $res
1380 echo $?/$^ERRNAME $res
1381 vput addrcodec res +e 10 (Ma)Braten Dr. (Heu) <doog@def>
1382 echo $?/$^ERRNAME $res
1383 eval vput addrcodec res d $res
1384 echo $?/$^ERRNAME $res
1385 vput addrcodec res +e 11 (Ma)Braten Dr"." (Heu) <doog@def>
1386 echo $?/$^ERRNAME $res
1387 eval vput addrcodec res d $res
1388 echo $?/$^ERRNAME $res
1389 vput addrcodec res +e 12 Dr. Sauer (Ma) Braten Dr. (u) <doog@def>
1390 echo $?/$^ERRNAME $res
1391 eval vput addrcodec res d $res
1392 echo $?/$^ERRNAME $res
1393 vput addrcodec res +e 13(Ma)Braten Dr. (Heu) <doog@def>
1394 echo $?/$^ERRNAME $res
1395 eval vput addrcodec res d $res
1396 echo $?/$^ERRNAME $res
1397 vput addrcodec res +e 14 Hey, Du <doog@def> Wie() findet Dr. das? ()
1398 echo $?/$^ERRNAME $res
1399 eval vput addrcodec res d $res
1400 echo $?/$^ERRNAME $res
1401 vput addrcodec res +e 15 \
1402 Hey, Du <doog@def> Wie() findet "" Dr. "" das? ()
1403 echo $?/$^ERRNAME $res
1404 eval vput addrcodec res d $res
1405 echo $?/$^ERRNAME $res
1406 vput addrcodec res +e 16 \
1407 "Hey," "Du" <doog@def> "Wie()" findet "" Dr. "" das? ()
1408 echo $?/$^ERRNAME $res
1409 eval vput addrcodec res d $res
1410 echo $?/$^ERRNAME $res
1411 vput addrcodec res +e 17 \
1412 "Hey" Du <doog@def> "Wie() findet " " Dr. """ das? ()
1413 echo $?/$^ERRNAME $res
1414 eval vput addrcodec res d $res
1415 echo $?/$^ERRNAME $res
1416 vput addrcodec res +e 18 \
1417 <doog@def> "Hey" Du "Wie() findet " " Dr. """ das? ()
1418 echo $?/$^ERRNAME $res
1419 eval vput addrcodec res d $res
1420 echo $?/$^ERRNAME $res
1421 vput addrcodec res +e 19 Hey\,\" <doog@def> "Wie()" findet \" Dr. \" das?
1422 echo $?/$^ERRNAME $res
1423 eval vput addrcodec res d $res
1424 echo $?/$^ERRNAME $res
1426 vput addrcodec res ++e 20 Hey\,\" <doog@def> "Wie()" findet \" Dr. \" das?
1427 echo $?/$^ERRNAME $res
1428 vput addrcodec res ++e 21 Hey\,\"" <doog@def> "Wie()" findet \" Dr. \" das?
1429 echo $?/$^ERRNAME $res
1430 eval vput addrcodec res d $res
1431 echo $?/$^ERRNAME $res
1433 vput addrcodec res +++e 22 Hey\,\" <doog@def> "Wie()" findet \" Dr. \" das?
1434 echo $?/$^ERRNAME $res
1435 eval vput addrcodec res d $res
1436 echo $?/$^ERRNAME $res
1438 vput addrcodec res s \
1439 "23 Hey\\,\\\" \"Wie" () "\" findet \\\" Dr. \\\" das?" <doog@def>
1440 echo $?/$^ERRNAME $res
1441 __EOT
1442 #0/NONE 1 <doog@def>
1443 #0/NONE 1 <doog@def>
1444 #0/NONE "2 ." <doog@def>
1445 #0/NONE 2 . <doog@def>
1446 #0/NONE "3 Sauer Dr." <doog@def>
1447 #0/NONE 3 Sauer Dr. <doog@def>
1448 #0/NONE 3.50 "Sauer \(Ma\) Dr." <doog@def>
1449 #0/NONE 3.50 Sauer (Ma) Dr. <doog@def>
1450 #0/NONE 3.51 "Sauer \(Ma\) \"Dr.\"" <doog@def>
1451 #0/NONE 3.51 Sauer (Ma) "Dr." <doog@def>
1452 #0/NONE 4 Sauer (Ma) "Dr." <doog@def>
1453 #0/NONE 4 Sauer (Ma) Dr. <doog@def>
1454 #0/NONE 5 Sauer (Ma) "Braten Dr." <doog@def>
1455 #0/NONE 5 Sauer (Ma) Braten Dr. <doog@def>
1456 #0/NONE 6 Sauer (Ma) "Braten Dr." (Heu) <doog@def>
1457 #0/NONE 6 Sauer (Ma) Braten Dr. (Heu) <doog@def>
1458 #0/NONE 7 Sauer (Ma) "Braten Dr." (Heu bu) <doog@def>
1459 #0/NONE 7 Sauer (Ma) Braten Dr. (Heu bu) <doog@def>
1460 #0/NONE "8 Dr. Sauer" (Ma) "Braten Dr." (Heu bu) "Boom. Boom" <doog@def>
1461 #0/NONE 8 Dr. Sauer (Ma) Braten Dr. (Heu bu) Boom. Boom <doog@def>
1462 #0/NONE "9 Dr.Sauer" (Ma) "Braten Dr." (Heu) <doog@def>
1463 #0/NONE 9 Dr.Sauer (Ma) Braten Dr. (Heu) <doog@def>
1464 #0/NONE 10 (Ma) "Braten Dr." (Heu) <doog@def>
1465 #0/NONE 10 (Ma) Braten Dr. (Heu) <doog@def>
1466 #0/NONE 11 (Ma) "Braten Dr\".\"" (Heu) <doog@def>
1467 #0/NONE 11 (Ma) Braten Dr"." (Heu) <doog@def>
1468 #0/NONE "12 Dr. Sauer" (Ma) "Braten Dr." (u) <doog@def>
1469 #0/NONE 12 Dr. Sauer (Ma) Braten Dr. (u) <doog@def>
1470 #0/NONE 13 (Ma) "Braten Dr." (Heu) <doog@def>
1471 #0/NONE 13 (Ma) Braten Dr. (Heu) <doog@def>
1472 #0/NONE "14 Hey, Du Wie" () "findet Dr. das?" () <doog@def>
1473 #0/NONE 14 Hey, Du Wie () findet Dr. das? () <doog@def>
1474 #0/NONE "15 Hey, Du Wie" () "findet \"\" Dr. \"\" das?" () <doog@def>
1475 #0/NONE 15 Hey, Du Wie () findet "" Dr. "" das? () <doog@def>
1476 #0/NONE "16 \"Hey,\" \"Du\" \"Wie" () "\" findet \"\" Dr. \"\" das?" () <doog@def>
1477 #0/NONE 16 "Hey," "Du" "Wie () " findet "" Dr. "" das? () <doog@def>
1478 #0/NONE "17 \"Hey\" Du \"Wie" () "findet \" \" Dr. \"\"\" das?" () <doog@def>
1479 #0/NONE 17 "Hey" Du "Wie () findet " " Dr. """ das? () <doog@def>
1480 #0/NONE "18 \"Hey\" Du \"Wie" () "findet \" \" Dr. \"\"\" das?" () <doog@def>
1481 #0/NONE 18 "Hey" Du "Wie () findet " " Dr. """ das? () <doog@def>
1482 #0/NONE "19 Hey\\,\\\" \"Wie" () "\" findet \\\" Dr. \\\" das?" <doog@def>
1483 #0/NONE 19 Hey\,\" "Wie () " findet \" Dr. \" das? <doog@def>
1484 #1/INVAL 20 Hey\\,\\" <doog@def> "Wie()" findet \\" Dr. \\" das?
1485 #0/NONE "21 Hey\\,\\ Wie() findet \\ Dr. \\ das?" <doog@def>
1486 #0/NONE 21 Hey\,\ Wie() findet \ Dr. \ das? <doog@def>
1487 #0/NONE "22 Hey\,\" Wie() findet \" Dr. \" das?" <doog@def>
1488 #0/NONE 22 Hey," Wie() findet " Dr. " das? <doog@def>
1489 #0/NONE doog@def
1490 cksum_test behave:addrcodec "${MBOX}" '3907388894 2416'
1493 t_behave_vexpr() {
1494 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} > "${MBOX}" 2>/dev/null
1495 vput vexpr res = 9223372036854775807
1496 echo $?/$^ERRNAME $res
1497 vput vexpr res = 9223372036854775808
1498 echo $?/$^ERRNAME $res
1499 vput vexpr res =@ 9223372036854775808
1500 echo $?/$^ERRNAME $res
1501 vput vexpr res = -9223372036854775808
1502 echo $?/$^ERRNAME $res
1503 vput vexpr res = -9223372036854775809
1504 echo $?/$^ERRNAME $res
1505 vput vexpr res =@ -9223372036854775809
1506 echo $?/$^ERRNAME $res
1507 echo ' #1'
1508 vput vexpr res ~ 0
1509 echo $?/$^ERRNAME $res
1510 vput vexpr res ~ 1
1511 echo $?/$^ERRNAME $res
1512 vput vexpr res ~ -1
1513 echo $?/$^ERRNAME $res
1514 echo ' #2'
1515 vput vexpr res + 0 0
1516 echo $?/$^ERRNAME $res
1517 vput vexpr res + 0 1
1518 echo $?/$^ERRNAME $res
1519 vput vexpr res + 1 1
1520 echo $?/$^ERRNAME $res
1521 echo ' #3'
1522 vput vexpr res + 9223372036854775807 0
1523 echo $?/$^ERRNAME $res
1524 vput vexpr res + 9223372036854775807 1
1525 echo $?/$^ERRNAME $res
1526 vput vexpr res +@ 9223372036854775807 1
1527 echo $?/$^ERRNAME $res
1528 vput vexpr res + 0 9223372036854775807
1529 echo $?/$^ERRNAME $res
1530 vput vexpr res + 1 9223372036854775807
1531 echo $?/$^ERRNAME $res
1532 vput vexpr res +@ 1 9223372036854775807
1533 echo $?/$^ERRNAME $res
1534 echo ' #4'
1535 vput vexpr res + -9223372036854775808 0
1536 echo $?/$^ERRNAME $res
1537 vput vexpr res + -9223372036854775808 -1
1538 echo $?/$^ERRNAME $res
1539 vput vexpr res +@ -9223372036854775808 -1
1540 echo $?/$^ERRNAME $res
1541 vput vexpr res + 0 -9223372036854775808
1542 echo $?/$^ERRNAME $res
1543 vput vexpr res + -1 -9223372036854775808
1544 echo $?/$^ERRNAME $res
1545 vput vexpr res +@ -1 -9223372036854775808
1546 echo $?/$^ERRNAME $res
1547 echo ' #5'
1548 vput vexpr res - 0 0
1549 echo $?/$^ERRNAME $res
1550 vput vexpr res - 0 1
1551 echo $?/$^ERRNAME $res
1552 vput vexpr res - 1 1
1553 echo $?/$^ERRNAME $res
1554 echo ' #6'
1555 vput vexpr res - 9223372036854775807 0
1556 echo $?/$^ERRNAME $res
1557 vput vexpr res - 9223372036854775807 -1
1558 echo $?/$^ERRNAME $res
1559 vput vexpr res -@ 9223372036854775807 -1
1560 echo $?/$^ERRNAME $res
1561 vput vexpr res - 0 9223372036854775807
1562 echo $?/$^ERRNAME $res
1563 vput vexpr res - -1 9223372036854775807
1564 echo $?/$^ERRNAME $res
1565 vput vexpr res - -2 9223372036854775807
1566 echo $?/$^ERRNAME $res
1567 vput vexpr res -@ -2 9223372036854775807
1568 echo $?/$^ERRNAME $res
1569 echo ' #7'
1570 vput vexpr res - -9223372036854775808 +0
1571 echo $?/$^ERRNAME $res
1572 vput vexpr res - -9223372036854775808 +1
1573 echo $?/$^ERRNAME $res
1574 vput vexpr res -@ -9223372036854775808 +1
1575 echo $?/$^ERRNAME $res
1576 vput vexpr res - 0 -9223372036854775808
1577 echo $?/$^ERRNAME $res
1578 vput vexpr res - +1 -9223372036854775808
1579 echo $?/$^ERRNAME $res
1580 vput vexpr res -@ +1 -9223372036854775808
1581 echo $?/$^ERRNAME $res
1582 echo ' #8'
1583 vput vexpr res + -13 -2
1584 echo $?/$^ERRNAME $res
1585 vput vexpr res - 0 0
1586 echo $?/$^ERRNAME $res
1587 vput vexpr res - 0 1
1588 echo $?/$^ERRNAME $res
1589 vput vexpr res - 1 1
1590 echo $?/$^ERRNAME $res
1591 vput vexpr res - -13 -2
1592 echo $?/$^ERRNAME $res
1593 echo ' #9'
1594 vput vexpr res * 0 0
1595 echo $?/$^ERRNAME $res
1596 vput vexpr res * 0 1
1597 echo $?/$^ERRNAME $res
1598 vput vexpr res * 1 1
1599 echo $?/$^ERRNAME $res
1600 vput vexpr res * -13 -2
1601 echo $?/$^ERRNAME $res
1602 echo ' #10'
1603 vput vexpr res / 0 0
1604 echo $?/$^ERRNAME $res
1605 vput vexpr res / 0 1
1606 echo $?/$^ERRNAME $res
1607 vput vexpr res / 1 1
1608 echo $?/$^ERRNAME $res
1609 vput vexpr res / -13 -2
1610 echo $?/$^ERRNAME $res
1611 echo ' #11'
1612 vput vexpr res % 0 0
1613 echo $?/$^ERRNAME $res
1614 vput vexpr res % 0 1
1615 echo $?/$^ERRNAME $res
1616 vput vexpr res % 1 1
1617 echo $?/$^ERRNAME $res
1618 vput vexpr res % -13 -2
1619 echo $?/$^ERRNAME $res
1620 __EOT
1621 #0/NONE 9223372036854775807
1622 #1/RANGE -1
1623 #0/OVERFLOW 9223372036854775807
1624 #0/NONE -9223372036854775808
1625 #1/RANGE -1
1626 #0/OVERFLOW -9223372036854775808
1627 # #1
1628 #0/NONE -1
1629 #0/NONE -2
1630 #0/NONE 0
1631 # #2
1632 #0/NONE 0
1633 #0/NONE 1
1634 #0/NONE 2
1635 # #3
1636 #0/NONE 9223372036854775807
1637 #1/OVERFLOW -1
1638 #0/OVERFLOW 9223372036854775807
1639 #0/NONE 9223372036854775807
1640 #1/OVERFLOW -1
1641 #0/OVERFLOW 9223372036854775807
1642 # #4
1643 #0/NONE -9223372036854775808
1644 #1/OVERFLOW -1
1645 #0/OVERFLOW -9223372036854775808
1646 #0/NONE -9223372036854775808
1647 #1/OVERFLOW -1
1648 #0/OVERFLOW -9223372036854775808
1649 # #5
1650 #0/NONE 0
1651 #0/NONE -1
1652 #0/NONE 0
1653 # #6
1654 #0/NONE 9223372036854775807
1655 #1/OVERFLOW -1
1656 #0/OVERFLOW 9223372036854775807
1657 #0/NONE -9223372036854775807
1658 #0/NONE -9223372036854775808
1659 #1/OVERFLOW -1
1660 #0/OVERFLOW -9223372036854775808
1661 # #7
1662 #0/NONE -9223372036854775808
1663 #1/OVERFLOW -1
1664 #0/OVERFLOW -9223372036854775808
1665 #0/NONE -9223372036854775808
1666 #1/OVERFLOW -1
1667 #0/OVERFLOW -9223372036854775808
1668 # #8
1669 #0/NONE -15
1670 #0/NONE 0
1671 #0/NONE -1
1672 #0/NONE 0
1673 #0/NONE -11
1674 # #9
1675 #0/NONE 0
1676 #0/NONE 0
1677 #0/NONE 1
1678 #0/NONE 26
1679 # #10
1680 #1/RANGE -1
1681 #0/NONE 0
1682 #0/NONE 1
1683 #0/NONE 6
1684 # #11
1685 #1/RANGE -1
1686 #0/NONE 0
1687 #0/NONE 0
1688 #0/NONE -1
1689 cksum_test behave:vexpr-numeric "${MBOX}" '1723609217 1048'
1691 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} > "${MBOX}" #2>/dev/null
1692 vput vexpr res find 'bananarama' 'nana'
1693 echo $?/$^ERRNAME :$res:
1694 vput vexpr res find 'bananarama' 'bana'
1695 echo $?/$^ERRNAME :$res:
1696 vput vexpr res find 'bananarama' 'Bana'
1697 echo $?/$^ERRNAME :$res:
1698 vput vexpr res find 'bananarama' 'rama'
1699 echo $?/$^ERRNAME :$res:
1700 echo ' #1'
1701 vput vexpr res ifind 'bananarama' 'nana'
1702 echo $?/$^ERRNAME :$res:
1703 vput vexpr res ifind 'bananarama' 'bana'
1704 echo $?/$^ERRNAME :$res:
1705 vput vexpr res ifind 'bananarama' 'Bana'
1706 echo $?/$^ERRNAME :$res:
1707 vput vexpr res ifind 'bananarama' 'rama'
1708 echo $?/$^ERRNAME :$res:
1709 echo ' #2'
1710 vput vexpr res substring 'bananarama' 1
1711 echo $?/$^ERRNAME :$res:
1712 vput vexpr res substring 'bananarama' 3
1713 echo $?/$^ERRNAME :$res:
1714 vput vexpr res substring 'bananarama' 5
1715 echo $?/$^ERRNAME :$res:
1716 vput vexpr res substring 'bananarama' 7
1717 echo $?/$^ERRNAME :$res:
1718 vput vexpr res substring 'bananarama' 9
1719 echo $?/$^ERRNAME :$res:
1720 vput vexpr res substring 'bananarama' 10
1721 echo $?/$^ERRNAME :$res:
1722 vput vexpr res substring 'bananarama' 1 3
1723 echo $?/$^ERRNAME :$res:
1724 vput vexpr res substring 'bananarama' 3 3
1725 echo $?/$^ERRNAME :$res:
1726 vput vexpr res substring 'bananarama' 5 3
1727 echo $?/$^ERRNAME :$res:
1728 vput vexpr res substring 'bananarama' 7 3
1729 echo $?/$^ERRNAME :$res:
1730 vput vexpr res substring 'bananarama' 9 3
1731 echo $?/$^ERRNAME :$res:
1732 vput vexpr res substring 'bananarama' 10 3
1733 echo $?/$^ERRNAME :$res:
1734 echo ' #3'
1735 __EOT
1736 #0/NONE :2:
1737 #0/NONE :0:
1738 #1/NODATA ::
1739 #0/NONE :6:
1740 # #1
1741 #0/NONE :2:
1742 #0/NONE :0:
1743 #0/NONE :0:
1744 #0/NONE :6:
1745 # #2
1746 #0/NONE :ananarama:
1747 #0/NONE :anarama:
1748 #0/NONE :arama:
1749 #0/NONE :ama:
1750 #0/NONE :a:
1751 #0/NONE ::
1752 #0/NONE :ana:
1753 #0/NONE :ana:
1754 #0/NONE :ara:
1755 #0/NONE :ama:
1756 #0/OVERFLOW :a:
1757 #0/OVERFLOW ::
1758 # #3
1759 cksum_test behave:vexpr-string "${MBOX}" '265398700 267'
1761 if have_feat regex; then
1762 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} > "${MBOX}" #2>/dev/null
1763 vput vexpr res regex 'bananarama' 'nana'
1764 echo $?/$^ERRNAME :$res:
1765 vput vexpr res regex 'bananarama' 'bana'
1766 echo $?/$^ERRNAME :$res:
1767 vput vexpr res regex 'bananarama' 'Bana'
1768 echo $?/$^ERRNAME :$res:
1769 vput vexpr res regex 'bananarama' 'rama'
1770 echo $?/$^ERRNAME :$res:
1771 echo ' #1'
1772 vput vexpr res iregex 'bananarama' 'nana'
1773 echo $?/$^ERRNAME :$res:
1774 vput vexpr res iregex 'bananarama' 'bana'
1775 echo $?/$^ERRNAME :$res:
1776 vput vexpr res iregex 'bananarama' 'Bana'
1777 echo $?/$^ERRNAME :$res:
1778 vput vexpr res iregex 'bananarama' 'rama'
1779 echo $?/$^ERRNAME :$res:
1780 echo ' #2'
1781 vput vexpr res regex 'bananarama' '(.*)nana(.*)' '\${1}a\${0}u{\$2}'
1782 echo $?/$^ERRNAME :$res:
1783 vput vexpr res regex 'bananarama' '(.*)bana(.*)' '\${1}a\${0}u\$2'
1784 echo $?/$^ERRNAME :$res:
1785 vput vexpr res regex 'bananarama' 'Bana(.+)' '\$1\$0'
1786 echo $?/$^ERRNAME :$res:
1787 vput vexpr res regex 'bananarama' '(.+)rama' '\$1\$0'
1788 echo $?/$^ERRNAME :$res:
1789 echo ' #3'
1790 vput vexpr res iregex 'bananarama' '(.*)nana(.*)' '\${1}a\${0}u{\$2}'
1791 echo $?/$^ERRNAME :$res:
1792 vput vexpr res iregex 'bananarama' '(.*)bana(.*)' '\${1}a\${0}u\$2'
1793 echo $?/$^ERRNAME :$res:
1794 vput vexpr res iregex 'bananarama' 'Bana(.+)' '\$1\$0'
1795 echo $?/$^ERRNAME :$res:
1796 vput vexpr res iregex 'bananarama' '(.+)rama' '\$1\$0'
1797 echo $?/$^ERRNAME :$res:
1798 echo ' #4'
1799 __EOT
1800 #0/NONE :2:
1801 #0/NONE :0:
1802 #1/NODATA ::
1803 #0/NONE :6:
1804 # #1
1805 #0/NONE :2:
1806 #0/NONE :0:
1807 #0/NONE :0:
1808 #0/NONE :6:
1809 # #2
1810 #0/NONE :baabananaramau{rama}:
1811 #0/NONE :abananaramaunarama:
1812 #1/NODATA ::
1813 #0/NONE :bananabananarama:
1814 # #3
1815 #0/NONE :baabananaramau{rama}:
1816 #0/NONE :abananaramaunarama:
1817 #0/NONE :naramabananarama:
1818 #0/NONE :bananabananarama:
1819 # #4
1820 cksum_test behave:vexpr-regex "${MBOX}" '3270360157 311'
1824 t_behave_call_ret() {
1825 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} -Snomemdebug > "${MBOX}" 2>&1
1826 define w1 {
1827 echon ">$1 "
1828 vput vexpr i + $1 1
1829 if [ $i -le 42 ]
1830 vput vexpr j '&' $i 7
1831 if [ $j -eq 7 ]
1832 echo .
1834 call w1 $i
1835 wysh set i=$? k=$!
1836 vput vexpr j '&' $i 7
1837 echon "<$1/$i/$k "
1838 if [ $j -eq 7 ]
1839 echo .
1841 else
1842 echo ! The end for $1
1844 return $1
1846 # Transport $?/$! up the call chain
1847 define w2 {
1848 echon ">$1 "
1849 vput vexpr i + $1 1
1850 if [ $1 -lt 42 ]
1851 call w2 $i
1852 wysh set i=$? j=$!
1853 echon "<$1/$i/$j "
1854 return $i $j
1855 else
1856 echo ! The end for $1
1857 return $i $^ERR-BUSY
1859 echoerr au
1861 # Up and down it goes
1862 define w3 {
1863 echon ">$1/$2 "
1864 vput vexpr i + $1 1
1865 if [ $1 -lt 42 ]
1866 call w3 $i $2
1867 wysh set i=$? j=$!
1868 vput vexpr k - $1 $2
1869 if [ $k -eq 21 ]
1870 vput vexpr i + $1 1
1871 vput vexpr j + $2 1
1872 echo "# <$i/$j> .. "
1873 call w3 $i $j
1874 wysh set i=$? j=$!
1876 echon "<$1=$i/$j "
1877 return $i $j
1878 else
1879 vput vexpr j + $^ERR-BUSY $2
1880 echo ! The end for $1=$i/$j
1881 return $i $j
1883 echoerr au
1886 call w1 0; echo ?=$? !=$!; echo -----;
1887 call w2 0; echo ?=$? !=$!; echo -----;
1888 call w3 0 1; echo ?=$? !=$!; echo -----;
1889 __EOT
1890 cksum_test behave:call_ret "${MBOX}" '2240086482 5844'
1893 t_behave_xcall() {
1894 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} -Snomemdebug > "${MBOX}" 2>&1
1895 define work {
1896 echon "$1 "
1897 vput vexpr i + $1 1
1898 if [ $i -le 1111 ]
1899 vput vexpr j '&' $i 7
1900 if [ $j -eq 7 ]
1901 echo .
1903 \xcall work $i $2
1905 echo ! The end for $1/$2
1906 if [ "$2" != "" ]
1907 return $i $^ERR-BUSY
1910 define xwork {
1911 \xcall work 0 $2
1913 call work 0
1914 echo ?=$? !=$!
1915 call xwork
1916 echo ?=$? !=$!
1917 xcall xwork
1918 echo ?=$? !=$!
1920 call work 0 yes
1921 echo ?=$? !=$!
1922 call xwork 0 yes
1923 echo ?=$? !=$!
1924 __EOT
1925 cksum_test behave:xcall "${MBOX}" '1579767783 19097'
1928 t_behave_e_H_L_opts() {
1929 TRAP_EXIT_ADDONS="./.tsendmail.sh ./.t.mbox"
1931 touch ./.t.mbox
1932 "${SNAIL}" ${ARGS} -ef ./.t.mbox
1933 echo ${?} > "${MBOX}"
1935 ${cat} <<-_EOT > ./.tsendmail.sh
1936 #!/bin/sh -
1937 (echo 'From Alchemilla Wed Apr 07 17:03:33 2017' && ${cat} && echo
1938 ) >> "./.t.mbox"
1939 _EOT
1940 chmod 0755 ./.tsendmail.sh
1941 printf 'm me@exam.ple\nLine 1.\nHello.\n~.\n' |
1942 "${SNAIL}" ${ARGS} -Smta=./.tsendmail.sh
1943 printf 'm you@exam.ple\nLine 1.\nBye.\n~.\n' |
1944 "${SNAIL}" ${ARGS} -Smta=./.tsendmail.sh
1946 "${SNAIL}" ${ARGS} -ef ./.t.mbox
1947 echo ${?} >> "${MBOX}"
1948 "${SNAIL}" ${ARGS} -efL @t@me ./.t.mbox
1949 echo ${?} >> "${MBOX}"
1950 "${SNAIL}" ${ARGS} -efL @t@you ./.t.mbox
1951 echo ${?} >> "${MBOX}"
1952 "${SNAIL}" ${ARGS} -efL '@>@Line 1' ./.t.mbox
1953 echo ${?} >> "${MBOX}"
1954 "${SNAIL}" ${ARGS} -efL '@>@Hello.' ./.t.mbox
1955 echo ${?} >> "${MBOX}"
1956 "${SNAIL}" ${ARGS} -efL '@>@Bye.' ./.t.mbox
1957 echo ${?} >> "${MBOX}"
1958 "${SNAIL}" ${ARGS} -efL '@>@Good bye.' ./.t.mbox
1959 echo ${?} >> "${MBOX}"
1961 "${SNAIL}" ${ARGS} -fH ./.t.mbox >> "${MBOX}"
1962 echo ${?} >> "${MBOX}"
1963 "${SNAIL}" ${ARGS} -fL @t@me ./.t.mbox >> "${MBOX}"
1964 echo ${?} >> "${MBOX}"
1965 "${SNAIL}" ${ARGS} -fL @t@you ./.t.mbox >> "${MBOX}"
1966 echo ${?} >> "${MBOX}"
1967 "${SNAIL}" ${ARGS} -fL '@>@Line 1' ./.t.mbox >> "${MBOX}"
1968 echo ${?} >> "${MBOX}"
1969 "${SNAIL}" ${ARGS} -fL '@>@Hello.' ./.t.mbox >> "${MBOX}"
1970 echo ${?} >> "${MBOX}"
1971 "${SNAIL}" ${ARGS} -fL '@>@Bye.' ./.t.mbox >> "${MBOX}"
1972 echo ${?} >> "${MBOX}"
1973 "${SNAIL}" ${ARGS} -fL '@>@Good bye.' ./.t.mbox >> "${MBOX}" 2>/dev/null
1974 echo ${?} >> "${MBOX}"
1976 ${rm} -f ${TRAP_EXIT_ADDONS}
1977 TRAP_EXIT_ADDONS=
1987 #>N 1 Alchemilla 1996-10-02 01:50 7/112
1988 # N 2 Alchemilla 1996-10-02 01:50 7/111
1990 #>N 1 Alchemilla 1996-10-02 01:50 7/112
1992 # N 2 Alchemilla 1996-10-02 01:50 7/111
1994 #>N 1 Alchemilla 1996-10-02 01:50 7/112
1995 # N 2 Alchemilla 1996-10-02 01:50 7/111
1997 #>N 1 Alchemilla 1996-10-02 01:50 7/112
1999 # N 2 Alchemilla 1996-10-02 01:50 7/111
2002 cksum_test behave:e_H_L_opts "${MBOX}" '1708955574 678'
2005 t_behave_compose_hooks() {
2006 TRAP_EXIT_ADDONS="./.tsendmail.sh ./.tnotes"
2008 ${cat} <<-_EOT > ./.tsendmail.sh
2009 #!/bin/sh -
2010 ${rm} -f "${MBOX}"
2011 (echo 'From PrimulaVeris Wed Apr 10 22:59:00 2017' && ${cat}) > "${MBOX}"
2012 _EOT
2013 chmod 0755 ./.tsendmail.sh
2015 printf 'm hook-test@exam.ple\nbody\n~.\nvar t_oce t_ocs t_ocs_shell t_ocl' |
2016 "${SNAIL}" ${ARGS} \
2017 -Smta=./.tsendmail.sh \
2019 define t_ocs {
2020 read ver
2021 echo t_ocs
2022 echo "~^header list"; read hl; vput vexpr es substr "$hl" 0 1
2023 if [ "$es" != 2 ]
2024 echoerr "Failed to header list, aborting send"; echo "~x"
2025 endif
2026 echo "~^header insert cc splicy diet <splice@exam.ple> spliced";\
2027 read es; vput vexpr es substr "$es" 0 1
2028 if [ "$es" != 2 ]
2029 echoerr "Failed to be diet, aborting send"; echo "~x"
2030 endif
2031 echo "~^header insert bcc juicy juice <juice@exam.ple> spliced";\
2032 read es; vput vexpr es substr "$es" 0 1
2033 if [ "$es" != 2 ]
2034 echoerr "Failed to be juicy, aborting send"; echo "~x"
2035 endif
2036 echo "~:set t_ocs"
2038 define t_oce {
2039 set t_oce autobcc=oce@exam.ple
2041 define t_ocl {
2042 set t_ocl autocc=ocl@exam.ple
2044 wysh set on-compose-splice=t_ocs \
2045 on-compose-splice-shell="read ver;printf \"t_ocs-shell\\n\
2046 ~t shell@exam.ple\\n~:set t_ocs_shell\\n\"" \
2047 on-compose-enter=t_oce on-compose-leave=t_ocl
2048 ' > ./.tnotes
2049 ${cat} ./.tnotes >> "${MBOX}"
2051 ${rm} -f ${TRAP_EXIT_ADDONS}
2052 TRAP_EXIT_ADDONS=
2054 #From PrimulaVeris Wed Apr 10 22:59:00 2017
2055 #Date: Wed, 02 Oct 1996 01:50:07 +0000
2056 #To: hook-test@exam.ple, shell@exam.ple
2057 #Cc: ocl@exam.ple, splicy diet spliced <splice@exam.ple>
2058 #Bcc: juicy juice spliced <juice@exam.ple>, oce@exam.ple
2060 #body
2061 #t_ocs-shell
2062 #t_ocs
2063 ##variable not set: t_oce
2064 ##variable not set: t_ocs
2065 ##variable not set: t_ocs_shell
2066 ##variable not set: t_ocl
2067 cksum_test behave:compose_hooks "${MBOX}" '3240856112 319'
2070 t_behave_smime() { # FIXME add test/ dir, unroll tests therein
2071 TRAP_EXIT_ADDONS="./.t.conf ./.tkey.pem ./.tcert.pem ./.tpair.pem"
2072 TRAP_EXIT_ADDONS="${TRAP_EXIT_ADDONS} ./.VERIFY ./.DECRYPT ./.ENCRYPT"
2073 TRAP_EXIT_ADDONS="${TRAP_EXIT_ADDONS} ./.tsendmail.sh"
2075 printf 'behave:s/mime: .. generating test key and certificate ..\n'
2076 ${cat} <<-_EOT > ./.t.conf
2077 [ req ]
2078 default_bits = 1024
2079 default_keyfile = keyfile.pem
2080 distinguished_name = req_distinguished_name
2081 attributes = req_attributes
2082 prompt = no
2083 output_password =
2085 [ req_distinguished_name ]
2086 C = GB
2087 ST = Over the
2088 L = rainbow
2089 O = S-nail
2090 OU = S-nail.smime
2091 CN = S-nail.test
2092 emailAddress = test@localhost
2094 [ req_attributes ]
2095 challengePassword =
2096 _EOT
2097 openssl req -x509 -nodes -days 3650 -config ./.t.conf \
2098 -newkey rsa:1024 -keyout ./.tkey.pem -out ./.tcert.pem >/dev/null 2>&1
2099 ${cat} ./.tkey.pem ./.tcert.pem > ./.tpair.pem
2101 printf "behave:s/mime:sign/verify: "
2102 echo bla | "${SNAIL}" ${ARGS} \
2103 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
2104 -Ssmime-sign -Sfrom=test@localhost \
2105 -s 'S/MIME test' ./.VERIFY
2106 printf 'verify\nx\n' |
2107 "${SNAIL}" ${ARGS} \
2108 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
2109 -Ssmime-sign -Sfrom=test@localhost \
2110 -Serrexit -R \
2111 -f ./.VERIFY >/dev/null 2>&1
2112 if [ $? -eq 0 ]; then
2113 printf 'ok\n'
2114 else
2115 printf 'error: verification failed\n'
2116 ESTAT=1
2117 ${rm} -f ${TRAP_EXIT_ADDONS}
2118 TRAP_EXIT_ADDONS=
2119 return
2121 printf ' .. disproof via openssl smime(1): '
2122 if openssl smime -verify -CAfile ./.tcert.pem \
2123 -in ./.VERIFY >/dev/null 2>&1; then
2124 printf 'ok\n'
2125 else
2126 printf 'failed\n'
2127 ESTAT=1
2128 ${rm} -f ${TRAP_EXIT_ADDONS}
2129 TRAP_EXIT_ADDONS=
2130 return
2133 # (signing +) encryption / decryption
2134 ${cat} <<-_EOT > ./.tsendmail.sh
2135 #!/bin/sh -
2136 ${rm} -f ./.ENCRYPT
2137 (echo 'From S-Postman Thu May 10 20:40:54 2012' && ${cat}) > ./.ENCRYPT
2138 _EOT
2139 chmod 0755 ./.tsendmail.sh
2141 printf "behave:s/mime:encrypt+sign/decrypt+verify: "
2142 echo bla |
2143 "${SNAIL}" ${ARGS} \
2144 -Ssmime-force-encryption \
2145 -Ssmime-encrypt-recei@ver.com=./.tpair.pem \
2146 -Smta=./.tsendmail.sh \
2147 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
2148 -Ssmime-sign -Sfrom=test@localhost \
2149 -s 'S/MIME test' recei@ver.com
2150 # TODO CHECK
2151 printf 'decrypt ./.DECRYPT\nfi ./.DECRYPT\nverify\nx\n' |
2152 "${SNAIL}" ${ARGS} \
2153 -Ssmime-force-encryption \
2154 -Ssmime-encrypt-recei@ver.com=./.tpair.pem \
2155 -Smta=./.tsendmail.sh \
2156 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
2157 -Ssmime-sign -Sfrom=test@localhost \
2158 -Serrexit -R \
2159 -f ./.ENCRYPT >/dev/null 2>&1
2160 if [ $? -eq 0 ]; then
2161 printf 'ok\n'
2162 else
2163 ESTAT=1
2164 printf 'error: decryption+verification failed\n'
2166 printf ' ..disproof via openssl smime(1): '
2167 if (openssl smime -decrypt -inkey ./.tkey.pem -in ./.ENCRYPT |
2168 openssl smime -verify -CAfile ./.tcert.pem) >/dev/null 2>&1; then
2169 printf 'ok\n'
2170 else
2171 printf 'failed\n'
2172 ESTAT=1
2174 ${sed} -e '/^Date:/d' -e '/^X-Decoding-Date/d' \
2175 -e \
2176 '/^Content-Disposition: attachment; filename="smime.p7s"/,/^-- /d' \
2177 < ./.DECRYPT > ./.ENCRYPT
2178 cksum_test ".. checksum of decrypted content" "./.ENCRYPT" '3090916509 510'
2180 printf "behave:s/mime:encrypt/decrypt: "
2181 ${rm} -f ./.DECRYPT
2182 echo bla | "${SNAIL}" ${ARGS} \
2183 -Ssmime-force-encryption \
2184 -Ssmime-encrypt-recei@ver.com=./.tpair.pem \
2185 -Smta=./.tsendmail.sh \
2186 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
2187 -Sfrom=test@localhost \
2188 -s 'S/MIME test' recei@ver.com
2189 printf 'decrypt ./.DECRYPT\nx\n' | "${SNAIL}" ${ARGS} \
2190 -Ssmime-force-encryption \
2191 -Ssmime-encrypt-recei@ver.com=./.tpair.pem \
2192 -Smta=./.tsendmail.sh \
2193 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
2194 -Sfrom=test@localhost \
2195 -Serrexit -R \
2196 -f ./.ENCRYPT >/dev/null 2>&1
2197 if [ $? -eq 0 ]; then
2198 printf 'ok\n'
2199 else
2200 ESTAT=1
2201 printf 'error: decryption failed\n'
2203 printf '.. disproof via openssl smime(1): '
2204 if openssl smime -decrypt -inkey ./.tkey.pem \
2205 -in ./.ENCRYPT >/dev/null 2>&1; then
2206 printf 'ok\n'
2207 else
2208 printf 'failed\n'
2209 ESTAT=1
2211 ${sed} -e '/^Date:/d' -e '/^X-Decoding-Date/d' \
2212 < ./.DECRYPT > ./.ENCRYPT
2213 cksum_test ".. checksum of decrypted content" ./.ENCRYPT '999887248 295'
2215 ${rm} -f ${TRAP_EXIT_ADDONS}
2216 TRAP_EXIT_ADDONS=
2219 # t_content()
2220 # Some basic tests regarding correct sending of mails, via STDIN / -t / -q,
2221 # including basic MIME Content-Transfer-Encoding correctness (quoted-printable)
2222 # Note we unfortunately need to place some statements without proper
2223 # indentation because of continuation problems
2224 t_content() {
2225 # MIME encoding (QP) stress message body
2226 printf \
2227 'Ich bin eine DÖS-Datäi mit sehr langen Zeilen und auch '\
2228 'sonst bin ich ganz schön am Schleudern, da kannste denke '\
2229 "wasde willst, gelle, gelle, gelle, gelle, gelle.\r\n"\
2230 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst \r\n"\
2231 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 1\r\n"\
2232 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 12\r\n"\
2233 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 123\r\n"\
2234 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 1234\r\n"\
2235 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 12345\r\n"\
2236 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 123456\r\n"\
2237 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 1234567\r\n"\
2238 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 12345678\r\n"\
2239 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 123456789\r\n"\
2240 "Unn ausserdem habe ich trailing SP/HT/SP/HT whitespace \r\n"\
2241 "Unn ausserdem habe ich trailing HT/SP/HT/SP whitespace \r\n"\
2242 "auf den zeilen vorher.\r\n"\
2243 "From am Zeilenbeginn und From der Mitte gibt es auch.\r\n"\
2244 ".\r\n"\
2245 "Die letzte Zeile war nur ein Punkt.\r\n"\
2246 "..\r\n"\
2247 "Das waren deren zwei.\r\n"\
2248 " \r\n"\
2249 "Die letzte Zeile war ein Leerschritt.\n"\
2250 "=VIER = EQUAL SIGNS=ON A LINE=\r\n"\
2251 "Prösterchen.\r\n"\
2252 ".\n"\
2253 "Die letzte Zeile war nur ein Punkt, mit Unix Zeilenende.\n"\
2254 "..\n"\
2255 "Das waren deren zwei. ditto.\n"\
2256 "Prösterchen.\n"\
2257 "Unn ausseerdem habe ich trailing SP/HT/SP/HT whitespace \n"\
2258 "Unn ausseerdem habe ich trailing HT/SP/HT/SP whitespace \n"\
2259 "auf den zeilen vorher.\n"\
2260 "ditto.\n"\
2261 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.\n"\
2262 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.1"\
2263 "\n"\
2264 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
2265 "\n"\
2266 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
2267 "3\n"\
2268 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
2269 "34\n"\
2270 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
2271 "345\n"\
2272 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
2273 "3456\n"\
2274 "QP am Zeilenende über soft-nl hinweg\n"\
2275 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende."\
2276 "ö123\n"\
2277 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende."\
2278 "1ö23\n"\
2279 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende."\
2280 "12ö3\n"\
2281 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende."\
2282 "123ö\n"\
2283 "=VIER = EQUAL SIGNS=ON A LINE=\n"\
2284 " \n"\
2285 "Die letzte Zeile war ein Leerschritt.\n"\
2286 ' '\
2287 > "${BODY}"
2289 # MIME encoding (QP) stress message subject
2290 SUB="Äbrä Kä?dä=brö Fü?di=bus? \
2291 adadaddsssssssddddddddddddddddddddd\
2292 ddddddddddddddddddddddddddddddddddd\
2293 ddddddddddddddddddddddddddddddddddd\
2294 dddddddddddddddddddd Hallelulja? Od\
2295 er?? eeeeeeeeeeeeeeeeeeeeeeeeeeeeee\
2296 eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\
2297 eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee f\
2298 fffffffffffffffffffffffffffffffffff\
2299 fffffffffffffffffffff ggggggggggggg\
2300 ggggggggggggggggggggggggggggggggggg\
2301 ggggggggggggggggggggggggggggggggggg\
2302 ggggggggggggggggggggggggggggggggggg\
2303 gggggggggggggggg"
2305 # Three tests for MIME encodign and (a bit) content classification.
2306 # At the same time testing -q FILE, < FILE and -t FILE
2308 ${rm} -f "${MBOX}"
2309 < "${BODY}" "${SNAIL}" ${ARGS} ${ADDARG_UNI} \
2310 -a "${BODY}" -s "${SUB}" "${MBOX}"
2311 cksum_test content:001 "${MBOX}" '2356108758 6413'
2313 ${rm} -f "${MBOX}"
2314 < /dev/null "${SNAIL}" ${ARGS} ${ADDARG_UNI} \
2315 -a "${BODY}" -s "${SUB}" -q "${BODY}" "${MBOX}"
2316 cksum_test content:002 "${MBOX}" '2356108758 6413'
2318 ${rm} -f "${MBOX}"
2319 ( echo "To: ${MBOX}" && echo "Subject: ${SUB}" && echo &&
2320 ${cat} "${BODY}"
2321 ) | "${SNAIL}" ${ARGS} ${ADDARG_UNI} -Snodot -a "${BODY}" -t
2322 cksum_test content:003 "${MBOX}" '2356108758 6413'
2324 # Test for [260e19d] (Juergen Daubert)
2325 ${rm} -f "${MBOX}"
2326 echo body | "${SNAIL}" ${ARGS} "${MBOX}"
2327 cksum_test content:004 "${MBOX}" '4004005686 49'
2329 # Sending of multiple mails in a single invocation
2330 ${rm} -f "${MBOX}"
2331 ( printf "m ${MBOX}\n~s subject1\nE-Mail Körper 1\n~.\n" &&
2332 printf "m ${MBOX}\n~s subject2\nEmail body 2\n~.\n" &&
2333 echo x
2334 ) | "${SNAIL}" ${ARGS} ${ADDARG_UNI}
2335 cksum_test content:005 "${MBOX}" '2157252578 260'
2337 ## $BODY CHANGED
2339 # "Test for" [d6f316a] (Gavin Troy)
2340 ${rm} -f "${MBOX}"
2341 printf "m ${MBOX}\n~s subject1\nEmail body\n~.\nfi ${MBOX}\np\nx\n" |
2342 "${SNAIL}" ${ARGS} ${ADDARG_UNI} -Spipe-text/plain="${cat}" > "${BODY}"
2343 ${sed} -e 1d < "${BODY}" > "${MBOX}"
2344 cksum_test content:006 "${MBOX}" '2273863401 83'
2346 # "Test for" [c299c45] (Peter Hofmann) TODO shouldn't end up QP-encoded?
2347 ${rm} -f "${MBOX}"
2348 ${awk} 'BEGIN{
2349 for(i = 0; i < 10000; ++i)
2350 printf "\xC3\xBC"
2351 #printf "\xF0\x90\x87\x90"
2352 }' | "${SNAIL}" ${ARGS} ${ADDARG_UNI} -s TestSubject "${MBOX}"
2353 cksum_test content:007 "${MBOX}" '1754234717 61767'
2355 ## Test some more corner cases for header bodies (as good as we can today) ##
2358 ${rm} -f "${MBOX}"
2359 echo | "${SNAIL}" ${ARGS} ${ADDARG_UNI} \
2360 -s 'a̲b̲c̲d̲e̲f̲h̲i̲k̲l̲m̲n̲o̲r̲s̲t̲u̲v̲w̲x̲z̲a̲b̲c̲d̲e̲f̲h̲i̲k̲l̲m̲n̲o̲r̲s̲t̲u̲v̲w̲x̲z̲' \
2361 "${MBOX}"
2362 cksum_test content:008 "${MBOX}" '1563381297 326'
2364 # Single word (overlong line split -- bad standard! Requires injection of
2365 # artificial data!! Bad can be prevented by using RFC 2047 encoding)
2366 ${rm} -f "${MBOX}"
2367 i=`${awk} 'BEGIN{for(i=0; i<92; ++i) printf "0123456789_"}'`
2368 echo | "${SNAIL}" ${ARGS} -s "${i}" "${MBOX}"
2369 cksum_test content:009 "${MBOX}" '1996714851 1669'
2371 # Combination of encoded words, space and tabs of varying sort
2372 ${rm} -f "${MBOX}"
2373 echo | "${SNAIL}" ${ARGS} ${ADDARG_UNI} \
2374 -s "1Abrä Kaspas1 2Abra Katä b_kaspas2 \
2375 3Abrä Kaspas3 4Abrä Kaspas4 5Abrä Kaspas5 \
2376 6Abra Kaspas6 7Abrä Kaspas7 8Abra Kaspas8 \
2377 9Abra Kaspastäb4-3 10Abra Kaspas1 _ 11Abra Katäb1 \
2378 12Abra Kadabrä1 After Tab after Täb this is NUTS" \
2379 "${MBOX}"
2380 cksum_test content:010 "${MBOX}" '2956039469 542'
2382 # Overlong multibyte sequence that must be forcefully split
2383 # todo This works even before v15.0, but only by accident
2384 ${rm} -f "${MBOX}"
2385 echo | "${SNAIL}" ${ARGS} ${ADDARG_UNI} \
2386 -s "✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄\
2387 ✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄\
2388 ✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄" \
2389 "${MBOX}"
2390 cksum_test content:011 "${MBOX}" '454973928 610'
2392 # Trailing WS
2393 ${rm} -f "${MBOX}"
2394 echo | "${SNAIL}" ${ARGS} \
2395 -s "1-1 B2 B3 B4 B5 B6 B\
2396 1-2 B2 B3 B4 B5 B6 B\
2397 1-3 B2 B3 B4 B5 B6 B\
2398 1-4 B2 B3 B4 B5 B6 B\
2399 1-5 B2 B3 B4 B5 B6 B\
2400 1-6 B2 B3 B4 B5 B6 " \
2401 "${MBOX}"
2402 cksum_test content:012 "${MBOX}" '1014122962 248'
2404 # Leading and trailing WS
2405 ${rm} -f "${MBOX}"
2406 echo | "${SNAIL}" ${ARGS} \
2407 -s " 2-1 B2 B3 B4 B5 B6 B\
2408 1-2 B2 B3 B4 B5 B6 B\
2409 1-3 B2 B3 B4 B5 B6 B\
2410 1-4 B2 B3 B4 B5 B6 " \
2411 "${MBOX}"
2412 cksum_test content:013 "${MBOX}" '3212167908 187'
2414 # Quick'n dirty RFC 2231 test; i had more when implementing it, but until we
2415 # have a (better) test framework materialize a quick shot
2416 ${rm} -f "${MBOX}"
2417 TRAP_EXIT_ADDONS=./.ttt
2419 mkdir ./.ttt || exit 1
2420 cd ./.ttt || exit 2
2421 : > "ma'ger.txt"
2422 : > "mä'ger.txt"
2423 : > 'diet\ is \curd.txt'
2424 : > 'diet "is" curd.txt'
2425 : > höde-tröge.txt
2426 : > höde__tröge__müde__dätte__hätte__vülle__gülle__äse__äße__säuerliche__kräuter__österliche__grüße__mäh.txt
2427 : > höde__tröge__müde__dätte__hätte__vuelle__guelle__aese__aesse__sauerliche__kräuter__österliche__grüße__mäh.txt
2428 : > hööööööööööööööööö_nöööööööööööööööööööööö_düüüüüüüüüüüüüüüüüüü_bäääääääääääääääääääääääh.txt
2429 : > ✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆.txt
2431 echo bla | "${SNAIL}" ${ARGS} ${ADDARG_UNI} \
2432 -a "./.ttt/ma'ger.txt" -a "./.ttt/mä'ger.txt" \
2433 -a './.ttt/diet\ is \curd.txt' -a './.ttt/diet "is" curd.txt' \
2434 -a ./.ttt/höde-tröge.txt \
2435 -a ./.ttt/höde__tröge__müde__dätte__hätte__vülle__gülle__äse__äße__säuerliche__kräuter__österliche__grüße__mäh.txt \
2436 -a ./.ttt/höde__tröge__müde__dätte__hätte__vuelle__guelle__aese__aesse__sauerliche__kräuter__österliche__grüße__mäh.txt \
2437 -a ./.ttt/hööööööööööööööööö_nöööööööööööööööööööööö_düüüüüüüüüüüüüüüüüüü_bäääääääääääääääääääääääh.txt \
2438 -a ./.ttt/✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆.txt \
2439 "${MBOX}"
2440 ${rm} -rf ./.ttt
2441 cksum_test content:14 "${MBOX}" '589846634 2491'
2442 # `resend' test
2443 printf "Resend ${BODY}\nx\n" | "${SNAIL}" ${ARGS} -f "${MBOX}"
2444 cksum_test content:14-2 "${MBOX}" '589846634 2491'
2447 t_all() {
2448 if have_feat devel; then
2449 ARGS="${ARGS} -Smemdebug"
2450 export ARGS
2452 t_behave
2453 t_content
2456 if [ -z "${CHECK_ONLY}" ]; then
2457 cc_all_configs
2458 else
2459 t_all
2462 [ ${ESTAT} -eq 0 ] && echo Ok || echo >&2 'Errors occurred'
2464 exit ${ESTAT}
2465 # s-sh-mode