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; }
36 [[ -s out1 ]] && err_exit 'type should not write on stdout for not found case'
37 [[ -s out2 ]] || err_exit 'type should write on stderr for not found case'
51 [[ $( foobar) == foobar1 ]] || err_exit 'foobar should output foobar1'
54 [[ $(foobar) == foobar2 ]] || err_exit 'foobar should output foobar2'
57 [[ $(foobar) == foobar1 ]] || err_exit 'foobar should output foobar1 again'
60 [[ ${ foobar;} == foobar2 ]] || err_exit 'foobar should output foobar2 with ${}'
61 [[ ${ dir2;} == dir2 ]] || err_exit 'should be dir2'
62 [[ ${ dir1;} == dir1 ]] 2> /dev/null && err_exit 'should not be be dir1'
65 [[ ${ foobar;} == foobar1 ]] || err_exit 'foobar should output foobar1 with ${}'
66 [[ ${ dir1;} == dir1 ]] || err_exit 'should be dir1'
67 [[ ${ dir2;} == dir2 ]] 2> /dev/null && err_exit 'should not be be dir2'
70 [[ ${ foobar;} == foobar2 ]] || err_exit 'foobar should output foobar2 with ${} again'
73 [[ $($SHELL -c 'print -r -- "$PATH"') == "$PATH" ]] || err_exit 'export PATH lost in subshell'
88 [[ $($SHELL ./bug1 2>/dev/null) == ok ]] || err_exit "PATH in function not working"
101 ($SHELL ./bug1) 2> /dev/null || err_exit "path_delete bug"
104 then err_exit 'not an error to run ksh on a directory'
109 then err_exit "$SHELL name not executing version in current directory"
112 then err_exit 'PATH export in command substitution not working'
144 then err_exit "leading : in path not working"
157 [[ $status == 126 ]] || err_exit "exit status of non-executable is $status -- 126 expected"
170 [[ $got == $exp ]] && err_exit "$cmd as last command should not find ./$cmd with PATH=/dev/null"
172 [[ $got == $exp ]] && err_exit "$cmd should not find ./$cmd with PATH=/dev/null"
175 [[ $got == $exp ]] || err_exit "whence $cmd should find ./$cmd with PATH=/dev/null"
178 [[ $got == $exp ]] || err_exit "whence \$PWD/$cmd should find ./$cmd with PATH=/dev/null"
183 [[ $got == $exp ]] || err_exit "whence ./$cmd failed -- expected '$exp', got '$got'"
185 [[ $got == $exp ]] || err_exit "whence \$PWD/$cmd failed -- expected '$exp', got '$got'"
194 [[ $got == $exp ]] && err_exit "$cmd as last command should not find ./$cmd with PATH=/dev/null"
196 [[ $got == $exp ]] && err_exit "$cmd should not find ./$cmd with PATH=/dev/null"
199 [[ $got == $exp ]] || err_exit "whence ./$cmd should find ./$cmd with PATH=/dev/null"
202 [[ $got == $exp ]] || err_exit "whence \$PWD/$cmd should find ./$cmd with PATH=/dev/null"
206 [[ $got == $exp ]] || err_exit "whence ./$cmd failed -- expected '$exp', got '$got'"
208 [[ $got == $exp ]] || err_exit "whence \$PWD/$cmd failed -- expected '$exp', got '$got'"
213 then err_exit 'trailing : in pathname not working'
218 then err_exit 'leading : in pathname not working'
222 then err_exit 'pathname not restored after scoping'
228 then err_exit '(PATH=$PWD/bin foo) does not find $PWD/bin/foo'
234 then err_exit 'setting PATH to Null not working'
238 then err_exit 'unsetting path not working'
245 [[ $x != "$y" ]] && err_exit 'PATH not restored after command substitution'
246 whence getconf > /dev/null && err_exit 'getconf should not be found'
252 [[ $(whence ls) == "$x" ]] || err_exit 'PATH search bug when .:$PWD in path'
254 [[ $(whence ls) == "$x" ]] || err_exit 'PATH search bug when :$PWD:. in path'
256 [[ $(whence ls) == /* ]] || err_exit 'whence not generating absolute pathname'
258 [[ $status == 127 ]] || err_exit "not found command exit status $status -- expected 127"
260 [[ $status == 126 ]] || err_exit "non executable command exit status $status -- expected 126"
262 [[ $status == 127 ]] || err_exit "not found command with ERR trap exit status $status -- expected 127"
264 [[ $status == 126 ]] || err_exit "non executable command ERR trap exit status $status -- expected 126"
271 [[ $(PATH=/usr/ucb/bin:/usr/bin echo -n ucb) == 'ucb' ]] || err_exit "ucb universe echo ignores -n option"
272 [[ $(PATH=/usr/xpg/bin:/usr/bin echo -n att) == '-n att' ]] || err_exit "att universe echo does not ignore -n option"
282 [[ "$got" == "$exp" ]] || err_exit "unreadable empty script should fail -- expected $exp, got $got"
284 [[ "$got" == "$exp" ]] || err_exit "command of unreadable empty script should fail -- expected $exp, got $got"
285 [[ "$(:; $scr; print $?)" == "$exp" ]] 2>/dev/null || err_exit "unreadable empty script in [[ ... ]] should fail -- expected $exp"
286 [[ "$(:; command $scr; print $?)" == "$exp" ]] 2>/dev/null || err_exit "command unreadable empty script in [[ ... ]] should fail -- expected $exp"
288 [[ "$got" == "$exp" ]] || err_exit "\$SHELL -c of unreadable empty script should fail -- expected $exp, got" $got
290 [[ "$got" == "$exp" ]] || err_exit "\$SHELL -c of command of unreadable empty script should fail -- expected $exp, got" $got
296 [[ "$got" == "$exp" ]] || err_exit "unreadable non-empty script should fail -- expected $exp, got $got"
298 [[ "$got" == "$exp" ]] || err_exit "command of unreadable non-empty script should fail -- expected $exp, got $got"
299 [[ "$(:; $scr; print $?)" == "$exp" ]] 2>/dev/null || err_exit "unreadable non-empty script in [[ ... ]] should fail -- expected $exp"
300 [[ "$(:; command $scr; print $?)" == "$exp" ]] 2>/dev/null || err_exit "command unreadable non-empty script in [[ ... ]] should fail -- expected $exp"
302 [[ "$got" == "$exp" ]] || err_exit "\$SHELL -c of unreadable non-empty script should fail -- expected $exp, got" $got
304 [[ "$got" == "$exp" ]] || err_exit "\$SHELL -c of command of unreadable non-empty script should fail -- expected $exp, got" $got