Lines Matching defs:err_exit

20 function err_exit
26 alias err_exit='err_exit $LINENO'
31 tmp=$(mktemp -dt) || { err_exit mktemp -dt failed; exit 1; }
34 [[ ${.sh.version} == "$KSH_VERSION" ]] || err_exit '.sh.version != KSH_VERSION'
36 [[ ${@ss} ]] && err_exit '${@ss} should be empty string when ss is unset'
37 [[ ${!ss} == ss ]] || err_exit '${!ss} should be ss when ss is unset'
38 [[ ${#ss} == 0 ]] || err_exit '${#ss} should be 0 when ss is unset'
41 then err_exit RANDOM variable not working
46 then err_exit SECONDS variable not working
51 then err_exit _ variable not working
59 #then err_exit ERRNO variable not working
63 then err_exit PWD variable failed, not equivalent to .
69 then err_exit "PPID variable failed -- expected '$exp', got '$got'"
75 then err_exit "OLDPWD variable failed -- expected '$old', got '$OLDPWD'"
77 cd $old || err_exit cd failed
83 then err_exit REPLY variable not working
92 then err_exit LINENO variable not working
98 then err_exit "word splitting on constants"
102 then err_exit ":: doesn't separate null arguments "
106 then err_exit "x\$1=value treated as an assignment"
112 then err_exit "attributes not passed to subshells"
123 then err_exit 'x.set does not override assignment'
132 then err_exit 'x.get does not work correctly'
141 then err_exit '$foo not null after unset in subsehll'
145 then err_exit 'unset foo in subshell produces side effect '
149 then err_exit '${foo?hi there} with foo unset does not print hi there on 2'
154 then err_exit '${@:0} not expanding correctly'
158 then err_exit '${@:0} not expanding correctly'
168 then err_exit " set discipline failure COUNT=$COUNT ACCESS=$ACCESS"
172 then err_exit "C locale not working"
183 then err_exit "foo.get discipline not working"
186 then err_exit "foo.get discipline not working after unset"
192 then err_exit '${#10}, where ${10}=10 not working'
198 then err_exit "\$$i not equal to \${$i}"
200 command eval bar='$'{$i%?} 2> /dev/null || err_exit "\${$i%?} gives syntax error"
202 then err_exit "\${$i%?} not correct"
204 command eval bar='$'{$i#?} 2> /dev/null || err_exit "\${$i#?} gives syntax error"
206 then err_exit "\${$i#?} not correct"
208 command eval foo='$'{$i} bar='$'{#$i} || err_exit "\${#$i} gives synta
211 then err_exit "\${#$i} not correct"
219 then err_exit 'CDPATH does not display new directory'
224 then err_exit 'CDPATH displays new directory when not used'
228 then err_exit "CDPATH ${tmp#/} does not display new directory"
233 then err_exit 'setting TMOUT in subshell affects parent'
247 then err_exit 'setdisc function not working'
253 then err_exit '\<newline> gets linenumber count wrong'
258 then err_exit '"${@-}" not expanding to null string'
261 do (eval : \${"$i"} 2> /dev/null) && err_exit "\${$i} not an syntax error"
268 then err_exit 'IFS=" " not causing adjacent space to be null string'
275 then err_exit 'IFS not restored after subshell'
297 *) err_exit "IFS=': '; set -- '$i'; expected '$s' got '$g'" ;;
302 *) err_exit "IFS=': '; read '$i'; expected '$r' got '$g'" ;;
416 then err_exit 'incorrect error message with ${12345?}'
420 then err_exit 'incorrect error message with ${foobar?}'
424 then err_exit 'incorrect error message with ${foobar?}'
437 } 2> /dev/null || err_exit 'SECONDS not working in function'
457 [[ $file == $tmp/script ]] || err_exit ".sh.file not working for dot scripts"
458 [[ $($SHELL $tmp/script) == $tmp/script ]] || err_exit ".sh.file not working for scripts"
459 [[ $(posixfun .sh.file) == $tmp/script ]] || err_exit ".sh.file not working for posix functions"
460 [[ $(fun .sh.file) == $tmp/script ]] || err_exit ".sh.file not working for functions"
461 [[ $(posixfun .sh.fun) == posixfun ]] || err_exit ".sh.fun not working for posix functions"
462 [[ $(fun .sh.fun) == fun ]] || err_exit ".sh.fun not working for functions"
463 [[ $(posixfun .sh.subshell) == 1 ]] || err_exit ".sh.subshell not working for posix functions"
464 [[ $(fun .sh.subshell) == 1 ]] || err_exit ".sh.subshell not working for functions"
466 [[ $(posixfun .sh.subshell) == 2 ]] || err_exit ".sh.subshell not working for posix functions in subshells"
467 [[ $(fun .sh.subshell) == 2 ]] || err_exit ".sh.subshell not working for functions in subshells"
468 (( .sh.subshell == 1 )) || err_exit ".sh.subshell not working in a subshell"
471 [[ $({ { time :;} 2>&1;}) == "$TIMEFORMAT" ]] || err_exit 'TIMEFORMAT not working'
473 [[ $(alias integer) == *.sh.* ]] && err_exit '.sh. prefixed to alias name'
475 [[ $(whence rm) == *.sh.* ]] && err_exit '.sh. prefixed to tracked alias name'
477 [[ $(cd /bin;env | grep PWD=) == *.sh.* ]] && err_exit '.sh. prefixed to PWD'
485 [[ $(typeset +f) == *dave.* ]] && err_exit 'unset discipline not removed'
491 [[ $got == new ]] || err_exit "previously unset environment variable not passed to script, expected 'new', got '$got'"
492 [[ ! $VAR ]] || err_exit "previously unset environment variable set after script, expected '', got '$VAR'"
497 [[ $got == new ]] || err_exit "environment variable covering local variable not passed to script, expected 'new', got '$got'"
498 [[ $VAR == old ]] || err_exit "previously set local variable changed after script, expected 'old', got '$VAR'"
503 [[ $got == new ]] || err_exit "environment variable covering environment variable not passed to script, expected 'new', got '$got'"
504 [[ $VAR == old ]] || err_exit "previously set environment variable changed after script, expected 'old', got '$VAR'"
518 1) err_exit 'append discipline not implemented';;
519 *) err_exit 'append discipline not working';;
527 } 2> /dev/null || err_exit "cannot add get discipline to .sh.foobar"
528 [[ ${.sh.foobar} == world ]] || err_exit 'get discipline for .sh.foobar not working'
532 [[ $2 == b ]] || err_exit '$2 should be b after set'
539 [[ $2 == b ]] || err_exit '$2 should be b after subshell'
542 [[ $pid == $! ]] || err_exit '$! value not preserved across subshells'
563 (( foo[bar] == 1 )) || err_exit 'foo[bar] should be 1'
564 [[ ${foo[barrier_hit]} == no ]] || err_exit 'foo[barrier_hit] should be no'
565 [[ ${foo[barrier_not_hit]} == yes ]] || err_exit 'foo[barrier_not_hit] should be yes'
568 (( foo[bar] == 5 )) || err_exit 'foo[bar] should be 5'
569 [[ ${foo[barrier_hit]} == yes ]] || err_exit 'foo[barrier_hit] should be yes'
570 [[ ${foo[barrier_not_hit]} == no ]] || err_exit 'foo[barrier_not_hit] should be no'
579 [[ ${x[@]} == '12 8 5 3' ]] || err_exit 'set discipline for indexed array not working correctly'
583 (( seconds < 12 || seconds > 12.1 )) && err_exit "SECONDS is $seconds and should be close to 12"
589 [[ $(a=1) == a=1 ]] || err_exit 'set discipline not working in subshell assignment'
590 [[ $(a=1 :) == a=1 ]] || err_exit 'set discipline not working in subshell command'
592 [[ ${.sh.subshell} == 0 ]] || err_exit '${.sh.subshell} should be 0'
594 [[ ${.sh.subshell} == 1 ]] || err_exit '${.sh.subshell} should be 1'
596 [[ ${.sh.subshell} == 2 ]] || err_exit '${.sh.subshell} should be 2'
601 (( $# == 32768 )) || err_exit "\$# failed -- expected 32768, got $#"
611 then [[ $r ]] && err_exit "unset $v failed -- expected '', got '$r'"
613 [[ $r == $x ]] || err_exit "$v=$x failed -- expected '$x', got '$r'"
614 else err_exit "unset $v; : \$$v failed"
622 [[ $r ]] && err_exit "unset $v failed -- expected '', got '$r'"
624 [[ $d ]] || err_exit "$v=$x failed -- expected locale diagnostic"
626 [[ $g == '' ]] || err_exit "$v=$x failed -- expected '', got '$g'"
628 [[ $g == 'C' ]] || err_exit "$v=C; $v=$x failed -- expected 'C', got '$g'"
638 [[ $got == "$exp" ]] || err_exit "unset SHLVL causes script failure -- expected '$exp', got '$got'"
647 [[ $got == "$exp" ]] || err_exit "cd with CDPATH after PATH change failed -- expected '$exp', got '$got'"
652 [[ -v $v ]] && err_exit "unset $v; [[ -v $v ]] failed"
654 [[ -v $v ]] || err_exit "$v=C; [[ -v $v ]] failed"
657 $SHELL -c "$cmd" 2>/dev/null || err_exit "'$cmd' exit status $?, expected 0"