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; }
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"
257 [[ $(typeset -p z) == "$x" ]] || err_exit "typeset -p for '$x' failed"
258 [[ $(typeset +p z) == "${x%%=*}" ]] || err_exit "typeset +p for '$x' failed"
262 [[ $(typeset -p z) == "$x" ]] || err_exit "typeset -p for '$x' failed"
263 [[ $(typeset +p z) == "${x%%=*}" ]] || err_exit "typeset +p for '$x' failed"
268 [[ $(typeset -p z) == "$x" ]] || err_exit "typeset -p for '$x' failed"
269 [[ $(typeset +p z) == "${x%%=*}" ]] || err_exit "typeset +p for '$x' failed"
279 [[ $(typeset -p z) == "Pt_t z=$x" ]] || err_exit "typeset -p for type failed"
280 [[ $(typeset +p z) == "Pt_t z" ]] || err_exit "typeset +p for type failed"
287 [[ $(foo) == bar=xxx ]] || err_exit 'typeset -p not working inside a function'
290 [[ $(typeset -p foo) == 'typeset -L 5 foo' ]] || err_exit 'typeset -p not working for variables with attributes but without a value'
296 } || err_exit 'typeset -L should not preserve old attributes'
302 } 2> /dev/null || err_exit 'typeset -R should not preserve old attributes'
308 [[ $foo == "$expected" ]] || err_exit 'read foo, where foo is "typeset -b -Z10" not working'
312 [[ $foo == "$expected" ]] || err_exit 'read -N10 foo, where foo is "typeset -b -Z10" not working'
316 [[ ${foo[4]} == "$expected" ]] || err_exit 'read -N10 foo, where foo is "typeset -b -A" foo not working'
320 [[ ${foo[4]} == "$expected" ]] || err_exit 'read -N10 foo, where foo is "typeset -b -a" foo not working'
321 [[ $(printf %B foo[4]) == abcdefghij ]] || err_exit 'printf %B for binary associative array element not working'
322 [[ $(printf %B foo[4]) == abcdefghij ]] || err_exit 'printf %B for binary indexed array element not working'
325 $SHELL 2> /dev/null -c 'export foo=(bar=3)' && err_exit 'compound variables cannot be exported'
353 [[ $got == $exp ]] || err_exit "[ '$2' '$3' '$4' ] env sequence failed -- expected '$exp', got '$got'"
361 [[ $v == *nul* ]] || err_exit 'typeset -H for /dev/null not working'