Lines Matching refs:err_exit

20 function err_exit
26 alias err_exit='err_exit $LINENO'
31 tmp=$(mktemp -dt) || { err_exit mktemp -dt failed; exit 1; }
39 (r=newval) 2> /dev/null && err_exit readonly attribute fails
42 then err_exit integer attributes fails
45 then err_exit integer base 8 fails
48 then err_exit uppercase fails
51 then err_exit lowercase fails
54 then err_exit reference variables fail
57 then err_exit tagged fails
60 then err_exit tagged fails
63 then err_exit zerofill fails
66 then err_exit right zerofill fails
70 then err_exit leftjust fails
73 then err_exit leftjust fails
76 then err_exit leftjust uppercase fails
79 then err_exit rightjust fails
82 then err_exit rightjust fails
85 then err_exit export fails
88 then err_exit export attributes fails
96 then err_exit 'environment variables require re-export'
98 (typeset + ) > /dev/null 2>&1 || err_exit 'typeset + not working'
101 then err_exit 'typeset allows negative field for left/right adjust'
106 then err_exit 'readonly $a=b not working'
109 then err_exit 'export not working'
117 then err_exit 'print of compound exponential variable not working'
122 then err_exit 'print of exponential shows both -E and -F attributes'
128 then err_exit 'attributes not cleared for script execution'
133 [[ $(< $tmp/script.1) == VAR= ]] || err_exit 'typeset -L should not be inherited'
145 then err_exit 'LAST!=2'
149 then err_exit 'LAST!=2'
151 [[ $(set | grep LAST) == LAST=02 ]] || err_exit "LAST not correct in set list"
156 then err_exit 'all export not working'
163 then err_exit 'all export not working with read'
166 then err_exit 'typeset without arguments outputs names without attributes'
181 [[ $(printf "%B" x) == $t1 ]] || err_exit 'typeset -b not working'
183 [[ $(printf "%B" a) == $w1 ]] || err_exit 'typeset -b -Z5 not working'
185 [[ $q == $b2 ]] || err_exit 'typeset -b not working with concatination'
186 [[ $(printf "%B" q) == $t1$t1 ]] || err_exit 'typeset -b concatination not working'
188 [[ $x == $b2 ]] || err_exit 'typeset -b not working with append'
189 [[ $(printf "%B" x) == $t1$t1 ]] || err_exit 'typeset -b append not working'
191 (( $(printf "%B" z | wc -c) == 20 )) || err_exit 'typeset -b -Z20 not storing 20 bytes'
199 [[ $v1 == "$b1" ]] || err_exit "v1=$v1 should be $b1"
200 [[ $v2 == "$x" ]] || err_exit "v1=$v2 should be $x"
202 then [[ $(env '!=1' $SHELL -c 'echo ok' 2>/dev/null) == ok ]] || err_exit 'malformed environment terminates shell'
207 [[ $var == MTIAMzQ= ]] || err_exit 'binary files with zeros not working'
210 then (( $var == 0xffff )) || err_exit 'unsigned short integers not working'
211 else err_exit 'typeset -usi cannot be used for unsigned short'
213 [[ $($SHELL -c 'unset foo;typeset -Z2 foo; print ${foo:-3}' 2> /dev/null) == 3 ]] || err_exit '${foo:-3} not 3 when typeset -Z2 field undefined'
214 [[ $($SHELL -c 'unset foo;typeset -Z2 foo; print ${foo:=3}' 2> /dev/null) == 03 ]] || err_exit '${foo:=-3} not 3 when typeset -Z2 foo undefined'
221 [[ $foo == hello ]] || err_exit 'export scoping problem in function'
224 [[ $(export | grep foo) == 'foo=hello' ]] || err_exit 'export not working in functions'
225 [[ $(export | grep bar) ]] && err_exit 'typeset -x not local'
226 [[ $($SHELL -c 'typeset -r IFS=;print -r $(pwd)' 2> /dev/null) == "$(pwd)" ]] || err_exit 'readonly IFS causes command substitution to fail'
228 [[ $(typeset -pa) == *fred* ]] || err_exit 'typeset -pa not working'
232 [[ $y == "3 " ]] || err_exit '-LZ3 not working for value 03'
233 [[ $x == "abc" ]] || err_exit '-LZ3 not working for value abcd'
234 [[ $x == "abc" ]] || err_exit '-LZ3 not working for value 00abcd'
237 [[ $(typeset -p z) ]] && err_exit "typeset -p for z undefined failed"
241 [[ $(typeset -p z) == "$x" ]] || err_exit "typeset -p for '$x' failed"
242 [[ $(typeset +p z) == "${x%=*}" ]] || err_exit "typeset +p for '$x' failed"
246 [[ $(typeset -p z) == "$x" ]] || err_exit "typeset -p for '$x' failed"
247 [[ $(typeset +p z) == "${x%=*}" ]] || err_exit "typeset +p for '$x' failed"
258 [[ $(typeset -p z) == "$x" ]] || err_exit "typeset -p for '$x' failed"
259 [[ $(typeset +p z) == "${x%%=*}" ]] || err_exit "typeset +p for '$x' failed"
263 [[ $(typeset -p z) == "$x" ]] || err_exit "typeset -p for '$x' failed"
264 [[ $(typeset +p z) == "${x%%=*}" ]] || err_exit "typeset +p for '$x' failed"
269 [[ $(typeset -p z) == "$x" ]] || err_exit "typeset -p for '$x' failed"
270 [[ $(typeset +p z) == "${x%%=*}" ]] || err_exit "typeset +p for '$x' failed"
281 [[ $(typeset -p z) == "Pt_t z=$x" ]] || err_exit "typeset -p for type failed"
282 [[ $(typeset +p z) == "Pt_t z" ]] || err_exit "typeset +p for type failed"
289 [[ $(foo) == bar=xxx ]] || err_exit 'typeset -p not working inside a function'
292 [[ $(typeset -p foo) == 'typeset -L 5 foo' ]] || err_exit 'typeset -p not working for variables with attributes but without a value'
298 } || err_exit 'typeset -L should not preserve old attributes'
304 } 2> /dev/null || err_exit 'typeset -R should not preserve old attributes'
310 [[ $foo == "$expected" ]] || err_exit 'read foo, where foo is "typeset -b -Z10" not working'
314 [[ $foo == "$expected" ]] || err_exit 'read -N10 foo, where foo is "typeset -b -Z10" not working'
318 [[ ${foo[4]} == "$expected" ]] || err_exit 'read -N10 foo, where foo is "typeset -b -A" foo not working'
322 [[ ${foo[4]} == "$expected" ]] || err_exit 'read -N10 foo, where foo is "typeset -b -a" foo not working'
323 [[ $(printf %B foo[4]) == abcdefghij ]] || err_exit 'printf %B for binary associative array element not working'
324 [[ $(printf %B foo[4]) == abcdefghij ]] || err_exit 'printf %B for binary indexed array element not working'
327 $SHELL 2> /dev/null -c 'export foo=(bar=3)' && err_exit 'compound variables cannot be exported'
355 [[ $got == $exp ]] || err_exit "[ '$2' '$3' '$4' ] env sequence failed -- expected '$exp', got '$got'"
363 [[ $v == *nul* ]] || err_exit 'typeset -H for /dev/null not working'
366 (typeset +C x) 2> /dev/null && err_exit 'typeset +C should be an error'
367 (typeset +A x) 2> /dev/null && err_exit 'typeset +A should be an error'
368 (typeset +a x) 2> /dev/null && err_exit 'typeset +a should be an error'
374 [[ $x == 5 ]] || err_exit 'integer -s not working'
376 [[ $(typeset -l) == *namespace*.sh* ]] && err_exit 'typeset -l should not contain namespace .sh'
382 [[ $got == $exp ]] || err_exit "typeset -l fails on numeric value -- expected '$exp', got '$got'"
386 [[ ${s[2]} == CHICKEN ]] || err_exit 'typeset -u not working with indexed arrays'
389 [[ ${s[2]} == CHICKEN ]] || err_exit 'typeset -u not working with associative arrays'
391 [[ $(print -v s) == "$expected" ]] || err_exit 'typeset -u for associative array does not display correctly'
395 then [[ $(typeset +p s) == 'typeset -M totitle s' ]] || err_exit 'typeset -M totitle does not display correctly with typeset -p'
406 (( $? )) && err_exit 'typeset + a[i] not working'
410 [[ -n "$groupDB" ]] && err_exit 'typeset -l -L1 causes unwanted side effect'
415 [[ $HISTFILE == foo ]] || err_exit 'typeset -u PS1 affects HISTFILE'
422 [[ $(printf "%B" x) == hello ]] || err_exit "append for typeset -b not working: got '$(printf "%B" x)' should get hello"
427 ) 2> /dev/null || err_exit 'typeset -p v[0] not working for simple variable v'
432 [[ $(typeset -p x) == "$expected" ]] || err_exit 'assignment elements in typeset -a assignment not working'
436 $SHELL -c "$z; [[ \$(typeset -pa) == '$z' ]]" || err_exit 'typeset -pa does not list only index arrays'
438 $SHELL -c "$z; [[ \$(typeset -pC) == '$z' ]]" || err_exit 'typeset -pC does not list only compound variables'
441 $SHELL -c "$z; [[ \$(typeset -pA) == '$z' ]]" || err_exit 'typeset -pA does not list only associative arrays'
443 $SHELL 2> /dev/null -c 'typeset -C arr=( aa bb cc dd )' && err_exit 'invalid compound variable assignment not reported'
447 [[ ${x:=foo} == foo ]] || err_exit '${x:=foo} with x unset, not foo when x is a lowercase variable'
451 [[ ${#x} == 5 ]] || err_exit "width of character '\01' is not zero"
455 command typeset -F x=0-1 2> /dev/null || err_exit 'typeset -F after typeset -L fails'
460 [[ $val == 0-1 ]] || err_exit 'integer attribute not cleared for subsequent typeset'
464 [[ $(typeset -p x) == 'typeset -Z 3 -L 3 x=foo' ]] || err_exit '-LRZ without [n] not defaulting to width of variable'
468 [[ $(typeset -p foo) == 'typeset -Z 2 -R 2 foo=03' ]] || err_exit '-Z2 not working'
470 [[ $(typeset -p foo) == 'typeset -x -Z 2 -R 2 foo=03' ]] || err_exit '-Z2 not working after export'