Lines Matching refs:err_exit

20 function err_exit  function
26 alias err_exit='err_exit $LINENO' alias
36 tmp=$(mktemp -dt) || { err_exit mktemp -dt failed; exit 1; }
59 then err_exit "command print not working inside print function"
64 then err_exit 'global variables not correct'
68 then err_exit '$0 not correct'
72 then err_exit 'environment override not correct'
75 then err_exit 'scoping error'
79 then err_exit non-local variables
84 then err_exit EXIT trap in wrong scope
86 unset -f foobar || err_exit "cannot unset function foobar"
87 typeset -f foobar>/dev/null && err_exit "typeset -f has incorrect exit status"
98 else err_exit 'return within subshell inside function error'
103 then err_exit 'abc() print hi not working'
107 then err_exit 'abc() print hi not working after subshell unset'
115 err_exit 'exit from function not working'
127 then err_exit 'value of x not restored after subshell inside function'
133 then err_exit 'cd inside nested subshell not working'
136 then err_exit 'cd inside nested subshell changes $PWD'
140 then err_exit one line functions not working
151 then err_exit 'passing args from functions to scripts not working'
162 then err_exit 'exit trap incorrectly triggered'
165 then err_exit 'exit trap incorrectly triggered when invoked with -c'
169 then err_exit 'exit trap not triggered when invoked with -c'
182 then err_exit 'arguments not restored by posix functions'
194 then err_exit 'function definitions inside subshells not working'
198 then err_exit 'function definitions inside subshells not restored'
213 then err_exit 'variable assignment list not using parent scope'
226 then err_exit 'autoload not working'
234 ( foobar ) 2> /dev/null || err_exit "cannot unset readonly variable in function"
238 then err_exit 'abc() without a function body is not a syntax error'
252 then err_exit 'getopts --man in functions not working'
255 then err_exit 'getopts with bad option in functions not working'
264 then err_exit 'name=value pair args not passed to traced functions'
274 then err_exit 'set -e not working for functions'
284 then err_exit 'set -e not disabled for functions'
294 then err_exit 'set -e not inherited for posix functions'
315 then err_exit "export inside function not working -- expected 'fun', got '$val'"
319 then err_exit "export not restored after function call -- expected 'base', got '$val'"
323 then err_exit "export inside function not working with recursive function -- expected 'fun2', got '…
327 then err_exit "export not restored after recursive function call -- expected 'base', got '$val'"
331 then err_exit "name=value not added to export list with function call -- expected 'try3', got '$val…
335 then err_exit "export not restored name=value function call -- expected 'base', got '$val'"
340 then err_exit "export inside function not working -- expected 'fun', got '$val'"
344 then err_exit "unset varaible exported after function call -- expected '', got '$val'"
355 then err_exit 'attributes on unset variables not saved/restored'
365 then err_exit 'for loop function optimization error'
384 closure 0 || err_exit -u2 'for loop function optimization bug2'
387 cd $dir || { err_exit "cd $dir failed"; exit 1; }
402 [[ $(<file) == *'Xprint 2'* ]] || err_exit 'function trace disabled by function call'
417 then err_exit 'ERR trap not cleared'
427 then err_exit "function file without function definition processes wrong error -- expected '$exp', …
430 [[ $(PATH=$PATH: $SHELL -c '. dotscript;print $#') == 3 ]] || err_exit 'positional parameters not p…
431 cd ~- || err_exit "cd back failed"
439 [[ $err == ERR ]] || err_exit 'trap on ERR not working in a function'
447 eval "$x" || err_exit 'typeset -f generates syntax error'
448 [[ $(foobar) != ok ]] && err_exit 'typeset -f not generating function'
457 [[ $(a) == a ]] || err_exit '.sh.fun not set correctly in a function'
458 print $'a(){\ndate\n}' | $SHELL 2> /dev/null || err_exit 'parser error in a(){;date;}'
750 cmp -s $tmp/data[12] || err_exit 'error with long functions'
761 f || err_exit "typeset optimization bug"
771 [[ $(foo=hello g) == hellobam ]] || err_exit 'function exports not passed on'
772 [[ $(bar=hello g) == bam ]] || err_exit 'function exports not overridden'
789 [[ $(foo 'NUMBERED RECORDSIZE') == ok ]] || err_exit 'optimization error with undefined variable'
804 [[ $x == failed ]] && err_exit 'ERR trap executed multiple times'
833 [[ $t ]] || err_exit "typeset +f \$$i failed"
847 ' || err_exit "compound variable cleanup before script exec failed"
857 ) 2> /dev/null || err_exit 'function main fails'
868 [[ $(sub -a) == OPTIND=2 ]] || err_exit 'OPTIND should be 2'
869 [[ $(sub -a) == OPTIND=2 ]] || err_exit 'OPTIND should be 2 again'
870 [[ $OPTIND == "$optind" ]] || err_exit 'OPTIND should be 1'
874 [[ -o nounset ]] && err_exit 'nounset option should not be inherited'
890 [[ ${ red } != 'red_one 0' ]] && err_exit 'expected red_one 0'
891 [[ ${ red } != 'red_one 1' ]] && err_exit 'expected red_one 1'
899 [[ $xyz == "$0" ]] || err_exit "\$xyz=$xyz does not match $0 on level ${.level}"
900 …[[ ${.sh.lineno} == "$1" ]] || err_exit "\${.sh.lineno}=${.sh.lineno} does not match $1 on level $…
933 [[ $(abc) == abc ]] || err_exit '.sh.fun.set not capturing function name'
934 [[ $(def) == def ]] || err_exit '.sh.fun.set not capturing name()'
955 then [[ $filename == "$basefile" ]] || err_exit "filename for level 0 is $filename not $basename"
957 [[ $line == "$baseline" ]] || err_exit "line number for level 0 is $line not $baseline"
959 …then [[ $filename == "$tmp/debug" ]] || err_exit "filename for level 1 is $filename not $tmp/debu…
960 [[ $* == 'foo bar' ]] || err_exit "args are '$*', not 'foo bar'"
961 [[ $line == $arg ]] || err_exit "line number for level 1 is $line not $arg"
962 else err_exit "level should be 0 or 1 but is $pos"
992 [[ $1 == $2 ]] && err_exit ".sh.inline optimization bug"
993 …n foo { typeset x=$1;print $1;};z=();z=($(foo bar)) ') 2> /dev/null || err_exit 'using a function…
1013 [[ $got == ok ]] || err_exit 'cannot handle comsub depth > 256 in function'
1027 [[ $(< $tmp2) == $pid ]] || err_exit 'wrong pid for & job in function'
1050 ) == foo ]] > /dev/null || err_exit 'functions compiled with shcomp not working'
1055 [[ $val == $'hello\nworld' ]] || err_exit "processing compiled dot files not working correctly val…
1073 [[ $(typeset +f) == *foo* ]] && err_exit 'function in subshell leaving side effect of function foo'
1076 [[ $(typeset +f) == *foo* ]] && err_exit 'function in subshell leaving side effects of function foo…
1077 [[ $(typeset +f) == *bar* ]] && err_exit 'function in subshell leaving side effects of function bar…
1087 [[ ${!bar[@]} == sub ]] || err_exit 'scoping problem with compound array variables'
1102 [[ $x == $'TRAP A\nTRAP B' ]] || err_exit "trap from functions in subshells fails got" $x
1109 [[ $bar ]] && err_exit 'unsetting local variable exposes global variable'
1124 [[ $x == ok ]] || err_exit 'TERM signal sent to last process of function kills the script'
1129 [[ $0 == "$dol0" ]] || err_exit "\$0 changed in func1() to $0"
1133 [[ $0 == func2 ]] || err_exit "\$0 changed in func2() to $0"
1148 } 2> /dev/null || err_exit 'problem with unset -f foo within function foo'
1158 [[ $val == f1xtrace*on*off*f2xtrace*on* ]] || err_exit "'.sh.fun.set() { set -x; }' not tracing all…
1166 i) [[ $OPTARG == foobar ]] || err_exit 'OPTARG should be set to foobar in function foo';;
1170 (( OPTIND == 4 )) || err_exit "OPTIND is $OPTIND at end of function foo; it should be 4"
1171 [[ $1 == foo2 ]] || err_exit "\$1 is $1, not foo after getopts in function"
1175 [[ $OPTARG == xxx ]] || err_exit 'getopts in function changes global OPTARG'
1176 (( OPTIND == 6 )) || err_exit 'getopts in function changes global OPTIND'
1180 …[[ $(typeset -f foo) == 'function foo { getopts --man; }' ]] || err_exit 'typeset -f not work for …
1192 …[[ $? == "${outvals[i]}" ]] || err_exit "function exit ${invals[i]} should set \$? to ${outvals[i]…
1208 [[ $rc == "$exp" ]] || err_exit "expected exitval $exp got $rc"