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; }
38 then err_exit "foo=$foo != bar=$bar"
42 then err_exit "foo=$foo != bar=$bar"
46 then err_exit "foo.child=${foo.child} != bar=${bar.child}"
58 then err_exit ".foo.bar=${.foo.bar} != hello"
61 then err_exit ".foo.bar.child=${.foo.bar.child} != child"
81 then err_exit "nameref or nameref not working"
85 then err_exit "${!x} not working"
95 then err_exit "function references not working"
98 then err_exit "typeset +n doesn't list names of reference variables"
101 then err_exit "typeset +n doesn't list values of reference variables"
109 then err_exit "value of nameref foo != $foo"
117 then err_exit "reference variable not cleared"
122 } 2> /dev/null && err_exit "self reference not detected"
129 then err_exit 'nameref of positional paramters outside of function not working'
138 foobar 2> /dev/null || err_exit 'nameref not unsetting previous reference'
143 then err_exit 'nameref short to longname compound assignment error'
145 ) 2> /dev/null|| err_exit 'nameref short to longname compound assignment error'
152 then err_exit 'for loop nameref optimization error'
161 then err_exit 'for loop nameref optimization test2 error'
166 then err_exit 'for loop optimization with namerefs not working'
175 then err_exit 'nameref optimization error'
186 done) != ok ]] && err_exit 'invalid for loop optimization of name references'
195 (( foo.bar == 5)) || err_exit 'nested nameref not working'
202 [[ $(selfref ps) == *a=1* ]] || err_exit 'local nameref cannot reference global variable of the same name'
208 [[ $(subref ps) == 1 ]] || err_exit 'local nameref cannot reference global variable child'
213 [[ $(subref ps) == 3 ]] || err_exit 'local nameref cannot reference caller compound variable'
221 local 2> /dev/null || err_exit 'function local has non-zero exit status'
222 [[ ${qs.a} == 3 ]] || err_exit 'function cannot set compound global variable'
231 [[ $(fun $i) == hi ]] || err_exit 'nameref for compound variable with in function name of caller fails'
236 [[ ${bar.x} == 3 ]] || err_exit 'nameref to subscript containing . fails'
237 [[ ${!bar} == 'foo[x.y]' ]] || err_exit '${!var} not correct for nameref to an array instance'
240 [[ ${!bar} == foo ]] || err_exit '${!var} not correct for nameref to array variable'
241 $SHELL -c 'function bar { nameref x=foo[++];};typeset -A foo;bar' 2> /dev/null ||err_exit 'nameref of associative array tries to evaluate subscript'
243 [[ $i == 4 ]] || err_exit 'creating reference from subscripted variable whose name is a reference failed'
257 ) == *foo=hello* ]] || err_exit 'unable to display compound variable from name reference of local variable'
263 ) != foo ]] && err_exit 'nameref x=[$c] '"not working for c=$c"
270 [[ $x == ok ]] || err_exit 'nameref to unset subscript not working'
283 [[ "$x" != 'x=19, y=20' ]] && err_exit "expected 'x=19, y=20', got '${x}'"
293 foo=1 bar=2;a) == $'1\n2' ]] 2> /dev/null || err_exit 'nameref in pipeline broken'
302 [[ $(a) == 'a.1 b.1' ]] || err_exit 'nameref choosing wrong scope -- '
309 [[ $zip == bar ]] || err_exit 'nameref to another nameref to array element fails'
310 [[ -R zip ]] || err_exit '[[ -R zip ]] should detect that zip is a reference'
311 [[ -R bam ]] || err_exit '[[ -R bam ]] should detect that bam is a reference'
312 [[ -R zip ]] || err_exit '[[ -v zip ]] should detect that zip is set'
313 [[ -v bam ]] || err_exit '[[ -v bam ]] should detect that bam is set'
314 [[ -R 123 ]] && err_exit '[[ -R 123 ]] should detect that 123 is not a reference'
315 [[ -v 123 ]] && err_exit '[[ -v 123 ]] should detect that 123 is not set'
326 foobar 2> /dev/null && err_exit 'invalid reference should cause foobar to fail'
327 [[ -v ref ]] && err_exit '$ref should be unset'
329 [[ $ref == 3 ]] || err_exit "\$ref is $ref, it should be 3"
337 [[ $(foobar) == ok ]] 2> /dev/null || err_exit 'nameref in function not creating variable in proper scope'
342 [[ $bar == 2 ]] || err_exit 'nameref scoping error'
353 [[ ${!y.@} == 'x[a].b' ]] || err_exit 'reference to array element not expanded with ${!y.@}'
358 command typeset -n n=v.${k//['./']/_} 2> /dev/null || err_exit 'patterns with quotes not handled correctly with name reference assignment'
363 [[ -v sp[19] ]] && err_exit '[[ -v sp[19] ]] where sp is a nameref should not be set'