Lines Matching defs:err_exit

20 function err_exit
26 alias err_exit='err_exit $LINENO'
33 tmp=$(mktemp -dt) || { err_exit mktemp -dt failed; exit 1; }
56 then err_exit "command print not working inside print function"
61 then err_exit 'global variables not correct'
65 then err_exit '$0 not correct'
69 then err_exit 'environment override not correct'
72 then err_exit 'scoping error'
76 then err_exit non-local variables
81 then err_exit EXIT trap in wrong scope
83 unset -f foobar || err_exit "cannot unset function foobar"
84 typeset -f foobar>/dev/null && err_exit "typeset -f has incorrect exit status"
95 else err_exit 'return within subshell inside function error'
100 then err_exit 'abc() print hi not working'
104 then err_exit 'abc() print hi not working after subshell unset'
112 err_exit 'exit from function not working'
124 then err_exit 'value of x not restored after subshell inside function'
130 then err_exit 'cd inside nested subshell not working'
133 then err_exit 'cd inside nested subshell changes $PWD'
137 then err_exit one line functions not working
148 then err_exit 'passing args from functions to scripts not working'
159 then err_exit 'exit trap incorrectly triggered'
162 then err_exit 'exit trap incorrectly triggered when invoked with -c'
166 then err_exit 'exit trap not triggered when invoked with -c'
179 then err_exit 'arguments not restored by posix functions'
191 then err_exit 'function definitions inside subshells not working'
195 then err_exit 'function definitions inside subshells not restored'
210 then err_exit 'variable assignment list not using parent scope'
223 then err_exit 'autoload not working'
231 ( foobar ) 2> /dev/null || err_exit "cannot unset readonly variable in function"
235 then err_exit 'abc() without a function body is not a syntax error'
249 then err_exit 'getopts --man in functions not working'
252 then err_exit 'getopts with bad option in functions not working'
261 then err_exit 'name=value pair args not passed to traced functions'
271 then err_exit 'set -e not working for functions'
281 then err_exit 'set -e not disabled for functions'
291 then err_exit 'set -e not inherited for posix functions'
312 then err_exit "export inside function not working -- expected 'fun', got '$val'"
316 then err_exit "export not restored after function call -- expected 'base', got '$val'"
320 then err_exit "export inside function not working with recursive function -- expected 'fun2', got '$val'"
324 then err_exit "export not restored after recursive function call -- expected 'base', got '$val'"
328 then err_exit "name=value not added to export list with function call -- expected 'try3', got '$val'"
332 then err_exit "export not restored name=value function call -- expected 'base', got '$val'"
337 then err_exit "export inside function not working -- expected 'fun', got '$val'"
341 then err_exit "unset varaible exported after function call -- expected '', got '$val'"
352 then err_exit 'attributes on unset variables not saved/restored'
362 then err_exit 'for loop function optimization error'
381 closure 0 || err_exit -u2 'for loop function optimization bug2'
384 cd $dir || { err_exit "cd $dir failed"; exit 1; }
399 [[ $(<file) == *'Xprint 2'* ]] || err_exit 'function trace disabled by function call'
414 then err_exit 'ERR trap not cleared'
424 then err_exit "function file without function definition processes wrong error -- expected '$exp', got '$got'"
427 [[ $(PATH=$PATH: $SHELL -c '. dotscript;print $#') == 3 ]] || err_exit 'positional parameters not preserved with . script without arguments'
428 cd ~- || err_exit "cd back failed"
436 [[ $err == ERR ]] || err_exit 'trap on ERR not working in a function'
444 eval "$x" || err_exit 'typeset -f generates syntax error'
445 [[ $(foobar) != ok ]] && err_exit 'typeset -f not generating function'
454 [[ $(a) == a ]] || err_exit '.sh.fun not set correctly in a function'
455 print $'a(){\ndate\n}' | $SHELL 2> /dev/null || err_exit 'parser error in a(){;date;}'
747 cmp -s $tmp/data[12] || err_exit 'error with long functions'
758 f || err_exit "typeset optimization bug"
768 [[ $(foo=hello g) == hellobam ]] || err_exit 'function exports not passed on'
769 [[ $(bar=hello g) == bam ]] || err_exit 'function exports not overridden'
786 [[ $(foo 'NUMBERED RECORDSIZE') == ok ]] || err_exit 'optimization error with undefined variable'
801 [[ $x == failed ]] && err_exit 'ERR trap executed multiple times'
830 [[ $t ]] || err_exit "typeset +f \$$i failed"
844 ' || err_exit "compound variable cleanup before script exec failed"
854 ) 2> /dev/null || err_exit 'function main fails'
865 [[ $(sub -a) == OPTIND=2 ]] || err_exit 'OPTIND should be 2'
866 [[ $(sub -a) == OPTIND=2 ]] || err_exit 'OPTIND should be 2 again'
867 [[ $OPTIND == "$optind" ]] || err_exit 'OPTIND should be 1'
871 [[ -o nounset ]] && err_exit 'nounset option should not be inherited'
887 [[ ${ red } != 'red_one 0' ]] && err_exit 'expected red_one 0'
888 [[ ${ red } != 'red_one 1' ]] && err_exit 'expected red_one 1'
896 [[ $xyz == "$0" ]] || err_exit "\$xyz=$xyz does not match $0 on level ${.level}"
897 [[ ${.sh.lineno} == "$1" ]] || err_exit "\${.sh.lineno}=${.sh.lineno} does not match $1 on level ${.level}"
930 [[ $(abc) == abc ]] || err_exit '.sh.fun.set not capturing function name'
931 [[ $(def) == def ]] || err_exit '.sh.fun.set not capturing name()'
952 then [[ $filename == "$basefile" ]] || err_exit "filename for level 0 is $filename not $basename"
954 [[ $line == "$baseline" ]] || err_exit "line number for level 0 is $line not $baseline"
956 then [[ $filename == "$tmp/debug" ]] || err_exit "filename for level 1 is $filename not $tmp/debug"
957 [[ $* == 'foo bar' ]] || err_exit "args are '$*', not 'foo bar'"
958 [[ $line == $arg ]] || err_exit "line number for level 1 is $line not $arg"
959 else err_exit "level should be 0 or 1 but is $pos"
989 [[ $1 == $2 ]] && err_exit ".sh.inline optimization bug"
990 ( $SHELL -c ' function foo { typeset x=$1;print $1;};z=();z=($(foo bar)) ') 2> /dev/null || err_exit 'using a function to set an array in a command sub fails'
1010 [[ $got == ok ]] || err_exit 'cannot handle comsub depth > 256 in function'
1024 [[ $(< $tmp2) == $pid ]] || err_exit 'wrong pid for & job in function'
1047 ) == foo ]] > /dev/null || err_exit 'functions compiled with shcomp not working'
1065 [[ $(typeset +f) == *foo* ]] && err_exit 'function in subshell leaving side effect of function foo'
1068 [[ $(typeset +f) == *foo* ]] && err_exit 'function in subshell leaving side effects of function foo after reload'
1069 [[ $(typeset +f) == *bar* ]] && err_exit 'function in subshell leaving side effects of function bar after reload'
1079 [[ ${!bar[@]} == sub ]] || err_exit 'scoping problem with compound array variables'
1094 [[ $x == $'TRAP A\nTRAP B' ]] || err_exit "trap from funtions in subshells fails got" $x