Lines Matching defs:err_exit

20 function err_exit
26 alias err_exit='err_exit $LINENO'
33 then err_exit "string1:0"
36 then err_exit "string1: -1"
39 then err_exit "string1:0"
42 then err_exit "string1:1"
45 then err_exit "string1:1:4"
48 then err_exit "string1: -5:4"
51 then err_exit "string1:1:j"
54 then err_exit "string1:(j?1:0):j"
57 then err_exit "string1%*zzz*"
60 then err_exit "string1%%*zzz*"
63 then err_exit "string1#*zzz*"
66 then err_exit "string1##*zzz*"
69 then err_exit "string1%+(abc)"
72 then err_exit "string1%%+(abc)"
75 then err_exit "string1%/*"
78 then err_exit '"string1%/*"'
81 then err_exit 'string1%"/*"'
84 then err_exit "string1%%/*"
87 then err_exit "string1#*bar"
90 then err_exit "string1#*bar"
93 then err_exit "string1#@(*/bar|*/foo)"
96 then err_exit "string1##@(*/bar|*/foo)"
99 then err_exit "string1##*/@(bar|foo)"
103 then err_exit "abc#a[b*} != abc"
106 then err_exit '${foo//[0-9]/bar} not expanding correctly'
110 then err_exit "(abc)#( != abc)"
113 then err_exit "(abc)%) != (abc"
117 then err_exit '${foo/[0-9]?/""} not expanding correctly'
120 then err_exit '${foo//[0-9]/""} not expanding correctly'
123 then err_exit '${foo/#a/b} not expanding correctly'
126 then err_exit '${foo/#?/b} not expanding correctly'
129 then err_exit '${foo/%c/b} not expanding correctly'
132 then err_exit '${foo/%?/b} not expanding correctly'
137 then err_exit "$pattern does not match $string"
140 then err_exit "\${$string##$pattern} not null"
143 then err_exit "\"\${$string##$pattern}\" not null"
146 then err_exit "\${$string/$pattern} not null"
149 then err_exit "$pattern matches $string"
160 then err_exit '${xx#*/} != a/b/c/d/e when xx=a/b/c/d/e'
163 then err_exit '${xx//\//\\} not working'
167 then err_exit 'closing brace escape not working'
171 then err_exit '${xx//%28/abc\)} not working'
176 do [[ $(eval print -r -- \"\${xx//:/\\${str:i:1}}\") == "a${str:i:1}b" ]] || err_exit "substitution of \\${str:i:1}} failed"
177 [[ $(eval print -rn -- \"\${xx//:/\'${str:i:1}\'}\") == "a${str:i:1}b" ]] || err_exit "substitution of '${str:i:1}' failed"
178 [[ $(eval print -r -- \"\${xx//:/\"${str:i:1}\"}\") == "a${str:i:1}b" ]] || err_exit "substitution of \"${str:i:1}\" failed"
180 [[ ${xx//:/\\n} == 'a\nb' ]] || err_exit "substituion of \\\\n failed"
181 [[ ${xx//:/'\n'} == 'a\nb' ]] || err_exit "substituion of '\\n' failed"
182 [[ ${xx//:/"\n"} == 'a\nb' ]] || err_exit "substituion of \"\\n\" failed"
183 [[ ${xx//:/$'\n'} == $'a\nb' ]] || err_exit "substituion of \$'\\n' failed"
187 then err_exit 'single quoting / in replacements failed'
190 then err_exit 'double quoting / in replacements failed'
193 then err_exit 'escaping / in replacements failed'
212 then err_exit 'export inside function not working'
216 then err_exit 'export not restored after function call'
219 then err_exit 'export inside function not working with recursive function'
223 then err_exit 'export not restored after recursive function call'
226 then err_exit 'name=value not added to export list with function call'
230 then err_exit 'export not restored name=value function call'
234 then err_exit 'export inside function not working for zzz'
237 then err_exit 'zzz exported after function call'
241 then err_exit '.sh.match not working with $@'
244 then err_exit '\1 not working with $@'
248 then err_exit '.sh.match not working with ${var[@]}'
251 then err_exit '\1 not working with ${var[@]}'
255 then err_exit '${var/+(\w)/Q} not workding'
258 then err_exit '${var//+(\w)/Q} not workding'
261 then err_exit '${var//+(\S)/Q} not workding'
264 [[ $(print -r -- ${foo//+/'|'}) != 'foo|bar|' ]] && err_exit "\${foobar//+/'|'}"
265 [[ $(print -r -- ${foo//+/"|"}) != 'foo|bar|' ]] && err_exit '${foobar//+/"|"}'
266 [[ $(print -r -- "${foo//+/'|'}") != 'foo|bar|' ]] && err_exit '"${foobar//+/'"'|'"'}"'
267 [[ $(print -r -- "${foo//+/"|"}") != 'foo|bar|' ]] && err_exit '"${foobar//+/"|"}"'
271 [[ ${.sh.match[0]} == dfg ]] || err_exit '.sh.match[0] not dfg'
272 [[ ${.sh.match[1]} == d ]] || err_exit '.sh.match[1] not d'
273 [[ ${.sh.match[2]} == g ]] || err_exit '.sh.match[2] not g'
276 [[ ${.sh.match[1]} == ddd ]] || err_exit '.sh.match[1] not ddd'
280 [[ ${b//$a/\1} == 123 ]] || err_exit "\${var/pattern} not working with \[ in pattern"
283 [[ ${foo/'('/'(x11-'} == '(x11-win32.i386) ' ]] || err_exit "\${var/pattern} not working with ' in pattern"
284 $SHELL -c $'v=\'$(hello)\'; [[ ${v//\'$(\'/-I\'$(\'} == -I"$v" ]]' 2> /dev/null || err_exit "\${var/pattern} not working with \$( as pattern"
286 $SHELL -c '[[ ! ${X[@]:0:300} ]]' 2> /dev/null || err_exit '${X[@]:0:300} with X undefined fails'
287 $SHELL -c '[[ ${@:0:300} == "$0" ]]' 2> /dev/null || err_exit '${@:0:300} with no arguments fails'
289 [[ ${i#{6}(?)} == 04 ]] || err_exit '${i#{6}(?)} not working'
290 [[ ${i#{6,6}(?)} == 04 ]] || err_exit '${i#{6,6}(?)} not working'
293 [[ $(printf "<%s>\n" ${i#' '}) == '<.>' ]] || err_exit 'printf "<%s>\n" ${i#' '} failed'
296 [[ "${x%o}(1)" == "fo(1)" ]] || err_exit 'print ${}() treated as pattern'
303 [[ $(string=$string $SHELL -c ": \${string/$pattern/}; print \${.sh.match[26]}") == Z ]] || err_exit -u2 'sh.match[26] not Z'
305 (( ${#.sh.match[@]} == 53 )) || err_exit '.sh.match has wrong number of elements'
306 [[ ${.sh.match[@]:2:4} == 'B C D E' ]] || err_exit '${.sh.match[@]:2:4} incorrect'
311 [[ ${x/*%(())*/\1} == '(-)' ]] || err_exit $M
313 [[ ${x/*%(())*/\1} == '(-)' ]] || err_exit $M
315 [[ ${x/*%(())*/\1} == '()' ]] || err_exit $M
317 [[ ${x/*%(())*/\1} == '(-\)' ]] || err_exit $M
319 [[ ${x/*%(())*/\1} == '(-\\)' ]] || err_exit $M
321 [[ ${x/*%(())*/\1} == '(-)' ]] || err_exit $M
323 [[ ${x/*%(())*/\1} == '(-)' ]] || err_exit $M
325 [[ ${x/*%(()[])*/\1} == '(-[-]-)' ]] || err_exit $M
327 [[ ${x/*%(()[])*/\1} == '(-)' ]] || err_exit $M
329 [[ ${x/*%(()[])*/\1} == '-(-[-)-]-' ]] || err_exit $M
331 [[ ${x/*%([]())*/\1} == '[-]' ]] || err_exit $M
333 [[ ${x/*%([]())*/\1} == '[-(-)-]' ]] || err_exit $M
335 [[ ${x/*%([]())*/\1} == '-(-[-)-]-' ]] || err_exit $M
338 [[ ${x/*%(())*/\1} == '(-)' ]] || err_exit $M
340 [[ ${x/~(-g)*%(())*/\1} == '((-))-' ]] || err_exit $M
342 [[ ${x/~(-g:*)*%(())*/\1} == '(-)' ]] || err_exit $M
344 [[ ${x/~(+g)*%(())*/\1} == '(-)' ]] || err_exit $M
346 [[ ${x/~(+g:*)*%(())*/\1} == '(-)' ]] || err_exit $M
348 [[ ${x/*(?)*%(())*(?)*/:\1:\2:\3:} == ':-(:(-):)-:' ]] || err_exit $M
350 [[ ${x/~(-g)*(?)*%(())*(?)*/:\1:\2:\3:} == '::((-))::-' ]] || err_exit $M
352 [[ ${x/~(-g:*(?))*%(())*(?)*/:\1:\2:\3:} == '::(-):)-:' ]] || err_exit $M
354 [[ ${x/~(+g)*(?)*%(())*(?)*/:\1:\2:\3:} == ':-(:(-):)-:' ]] || err_exit $M
356 [[ ${x/~(+g:*(?))*%(())*(?)*/:\1:\2:\3:} == ':-(:(-):)-:' ]] || err_exit $M
358 [[ ${x/+([[:alnum:]])*([[:space:]])(*%(()))*/:\1:\2:\3:} == ':call::(a+b,x/(c/d),(0)):' ]] || err_exit $M
361 [[ ${x/*%(()D${D})*/\1} == '-(-;-)-' ]] || err_exit $M
363 [[ ${x/*%(()D${D})*/\1} == '(-)' ]] || err_exit $M
365 [[ ${x/*%(()D${D})*/\1} == '(-)' ]] || err_exit $M
367 [[ ${x/*%(()D${D}E${E})*/\1} == '(-\;-)' ]] || err_exit $M
369 [[ ${x/*%(()D${D}E${E})*/\1} == '(-)' ]] || err_exit $M
371 [[ ${x/*%(()D${D}E${E})*/\1} == '(-)' ]] || err_exit $M
374 [[ ${x/*%(()Q${Q})*/\1} == '(-")"-)' ]] || err_exit $M
376 [[ ${x/*%(()Q${Q})*/\1} == '(-\")"-)' ]] || err_exit $M
378 [[ ${x/*%(()Q${Q})*/\1} == '(-\")\"-)' ]] || err_exit $M
380 [[ ${x/*%(()Q${S}Q${Q})*/\1} == $'(-\\\'")\\\'-)' ]] || err_exit $M
382 [[ ${x/*%(()Q${S}Q${Q})*/\1} == $'-(-\\\'")"-)-' ]] || err_exit $M
384 [[ ${x/*%(()Q${S}Q${Q})*/\1} == $'(-\\\'")"\'-)' ]] || err_exit $M
386 [[ ${x/*%(()Q${S}Q${Q})*/\1} == $'(-\\"\')\'\\"-)' ]] || err_exit $M
388 [[ ${x/*%(()Q${S}Q${Q})*/\1} == $'-(-\')\\\'\'-)-' ]] || err_exit $M
390 [[ ${x/*%(()L${S}Q${Q})*/\1} == $'(-\'")\'-)' ]] || err_exit $M
392 [[ ${x/*%(()L${S}Q${Q})*/\1} == $'-(-\\\'")"-)-' ]] || err_exit $M
394 [[ ${x/*%(()L${S}Q${Q})*/\1} == $'(-\\\'")"\'-)' ]] || err_exit $M
396 [[ ${x/*%(()L${S}Q${Q})*/\1} == $'(-\\"\')\'\\"-)' ]] || err_exit $M
398 [[ ${x/*%(()L${S}Q${Q})*/\1} == $'-(-\')\\\'\'-)-' ]] || err_exit $M
400 [[ ${x/*%(()Q${Q})*/\1} == '(-")"-)' ]] || err_exit $M
402 [[ ${x/*%(()Q${Q})*/\1} == '(-\")"-)' ]] || err_exit $M
404 [[ ${x/*%(()Q${Q})*/\1} == '(-\")\"-)' ]] || err_exit $M
407 [[ ${x/*%(()E${E})*/\1} == '(-\)-)' ]] || err_exit $M
409 [[ ${x/*%(()E${E})*/\1} == '(-\\)' ]] || err_exit $M
411 [[ ${x/*%(()E${E}Q${Q})*/\1} == '(-\")' ]] || err_exit $M
413 [[ ${x/*%(()E${E}Q${Q})*/\1} == '(-\")' ]] || err_exit $M
415 [[ ${x/*%(()E${E}Q${S}Q${Q})*/\1} == $'-(-\'")"-)-' ]] || err_exit $M
417 [[ ${x/*%(()E${E}Q${S}Q${Q})*/\1} == $'(-\\\'")"-)' ]] || err_exit $M
419 [[ ${x/*%(()E${E}Q${S}Q${Q})*/\1} == $'(-\\"\')\'\\"-)' ]] || err_exit $M
421 [[ ${x/*%(()E${E}L${S}Q${Q})*/\1} == $'(-\\\'")"-)' ]] || err_exit $M
423 [[ ${x/*%(()E${E}L${S}Q${Q})*/\1} == $'(-\\"\')\'\\"-)' ]] || err_exit $M
425 [[ ${x/*%(()E${E}L${S}Q${Q})*/\1} == $'(-\\"\')\\\'\\"-)' ]] || err_exit $M
427 [[ ${x/*%(()E${E}L${S}Q${Q})*/\1} == $'-(-\\"\')\\\'\\"\'-)-' ]] || err_exit $M
430 [[ ${x/*%(()D\;)*/\1} == '-(-;-)-' ]] || err_exit $M
432 [[ ${x/*%(()D\;)*/\1} == '(-)' ]] || err_exit $M
434 [[ ${x/*%(()D\;)*/\1} == '(-)' ]] || err_exit $M
436 [[ ${x/*%(()D\;E\\)*/\1} == '(-\;-)' ]] || err_exit $M
438 [[ ${x/*%(()D\;E\\)*/\1} == '(-)' ]] || err_exit $M
440 [[ ${x/*%(()D\;E\\)*/\1} == '(-)' ]] || err_exit $M
442 [[ ${x/*%(()D\;E\\)*/\1} == '(-)' ]] || err_exit $M
445 [[ ${x/*%(()Q\")*/\1} == '(-")"-)' ]] || err_exit $M
447 [[ ${x/*%(()Q\")*/\1} == '(-\")"-)' ]] || err_exit $M
449 [[ ${x/*%(()Q\")*/\1} == '(-\")\"-)' ]] || err_exit $M
451 [[ ${x/*%(()Q\'Q\")*/\1} == $'(-\\\'")\\\'-)' ]] || err_exit $M
453 [[ ${x/*%(()Q\'Q\")*/\1} == $'-(-\\\'")"-)-' ]] || err_exit $M
455 [[ ${x/*%(()Q\'Q\")*/\1} == $'(-\\\'")"\'-)' ]] || err_exit $M
457 [[ ${x/*%(()Q\'Q\")*/\1} == $'(-\\"\')\'\\"-)' ]] || err_exit $M
459 [[ ${x/*%(()Q\'Q\")*/\1} == $'-(-\')\\\'\'-)-' ]] || err_exit $M
461 [[ ${x/*%(()L\'Q\")*/\1} == $'(-\'")\'-)' ]] || err_exit $M
463 [[ ${x/*%(()L\'Q\")*/\1} == $'-(-\\\'")"-)-' ]] || err_exit $M
465 [[ ${x/*%(()L\'Q\")*/\1} == $'(-\\\'")"\'-)' ]] || err_exit $M
467 [[ ${x/*%(()L\'Q\")*/\1} == $'(-\\"\')\'\\"-)' ]] || err_exit $M
469 [[ ${x/*%(()L\'Q\")*/\1} == $'-(-\')\\\'\'-)-' ]] || err_exit $M
471 [[ ${x/*%(()Q\")*/\1} == '(-")"-)' ]] || err_exit $M
473 [[ ${x/*%(()Q\")*/\1} == '(-\")"-)' ]] || err_exit $M
475 [[ ${x/*%(()Q\")*/\1} == '(-\")\"-)' ]] || err_exit $M
478 [[ ${x/*%(()E\\)*/\1} == '(-\)-)' ]] || err_exit $M
480 [[ ${x/*%(()E\\)*/\1} == '(-\\)' ]] || err_exit $M
482 [[ ${x/*%(()E\\Q\")*/\1} == '(-\")' ]] || err_exit $M
484 [[ ${x/*%(()E\\Q\")*/\1} == '(-\")' ]] || err_exit $M
486 [[ ${x/*%(()E\\Q\'Q\")*/\1} == $'-(-\'")"-)-' ]] || err_exit $M
488 [[ ${x/*%(()E\\Q\'Q\")*/\1} == $'(-\\\'")"-)' ]] || err_exit $M
490 [[ ${x/*%(()E\\Q\'Q\")*/\1} == $'(-\\"\')\'\\"-)' ]] || err_exit $M
492 [[ ${x/*%(()E\\L\'Q\")*/\1} == $'(-\\\'")"-)' ]] || err_exit $M
494 [[ ${x/*%(()E\\L\'Q\")*/\1} == $'(-\\"\')\'\\"-)' ]] || err_exit $M
496 [[ ${x/*%(()E\\L\'Q\")*/\1} == $'(-\\"\')\\\'\\"-)' ]] || err_exit $M
498 [[ ${x/*%(()E\\L\'Q\")*/\1} == $'-(-\\"\')\\\'\\"\'-)-' ]] || err_exit $M
502 [[ $( print $(( ${var%%00} )) ) == 1 ]] || err_exit "arithmetic with embeddded patterns fails"
503 [[ $( print $(( ${var%%$pattern} )) ) == 1 ]] || err_exit "arithmetic with embeddded pattern variables fails"
505 then err_exit '${.sh.match[1]:1:${#.sh.match[1]}} not expanding correctly'
510 [[ ${string/*\(+([!\)])\)*/\1} == "$expected" ]] || err_exit "substring expansion failed '${string/*\(+([!\)])\)*/\1}' returned -- '$expected' expected"
512 then LC_ALL=en_US.UTF-8 $SHELL -c b1=$'"\342\202\254\342\202\254\342\202\254\342\202\254w\342\202\254\342\202\254\342\202\254\342\202\254"; [[ ${b1:4:1} == w ]]' || err_exit 'multibyte ${var:offset:len} not working correctly'
514 { $SHELL -c 'unset x;[[ ${SHELL:$x} == $SHELL ]]';} 2> /dev/null || err_exit '${var:$x} fails when x is not set'
515 { $SHELL -c 'x=;[[ ${SHELL:$x} == $SHELL ]]';} 2> /dev/null || err_exit '${var:$x} fails when x is null'
559 then err_exit "i='$1'; \${i/~($2)$3/\\(\\0\\)} failed -- expected '$4', got '$o'"
563 then err_exit "i='$1'; \${i/~($2)($3)/\\(\\1\\)} failed -- expected '$4', got '$o'"