Home
last modified time | relevance | path

Searched refs:err_exit (Results 1 – 25 of 117) sorted by relevance

12345

/illumos-gate/usr/src/contrib/ast/src/cmd/ksh93/tests/
H A Dbracket.sh20 function err_exit function
26 alias err_exit='err_exit $LINENO' alias
31 tmp=$(mktemp -dt) || { err_exit mktemp -dt failed; exit 1; }
36 then err_exit "-z: null string should be of zero length"
41 then err_exit "-z: $file string should not be of zero length"
44 then err_exit "-a: $file shouldn't exist"
47 then err_exit "-e: $file shouldn't exist"
51 then err_exit "-a: $file should exist"
54 then err_exit "-e: $file should exist"
58 then err_exit "-r: $file should be readable"
[all …]
H A Dsubstring.sh20 function err_exit function
26 alias err_exit='err_exit $LINENO' alias
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"
[all …]
H A Dbuiltins.sh20 function err_exit function
26 alias err_exit='err_exit $LINENO' alias
31 tmp=$(mktemp -dt) || { err_exit mktemp -dt failed; exit 1; }
36 : ${foo=bar} || err_exit ": failed"
37 [[ $foo == bar ]] || err_exit ": side effects failed"
42 getopts :x: foo || err_exit "getopts :x: returns false"
43 [[ $foo == x && $OPTARG == foobar ]] || err_exit "getopts :x: failed"
47 then err_exit "'getopts :r:s var -r' not working"
52 then err_exit "'getopts :d#u OPT=d OPTARG=16177' failed -- OPT=$OPT OPTARG=$OPTARG"
56 do [[ $OPTIND == $((OPTIND)) ]] || err_exit "OPTIND optimization bug"
[all …]
H A Darrays.sh20 function err_exit function
26 alias err_exit='err_exit $LINENO' alias
31 tmp=$(mktemp -dt) || { err_exit mktemp -dt failed; exit 1; }
45 then err_exit '$x is not element 0'
48 then err_exit '${x[0] is not element 0'
51 then err_exit "length of ${x[0]} is not 4"
54 then err_exit 'number of elements of x is not 6'
57 then err_exit ' element two is not 2'
60 then err_exit ' ${x[@]:2:1} is not two'
64 then err_exit '$x is not element 0'
[all …]
H A Dattributes.sh20 function err_exit function
26 alias err_exit='err_exit $LINENO' alias
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
[all …]
H A Doptions.sh20 function err_exit function
26 alias err_exit='err_exit $LINENO' alias
36 tmp=$(mktemp -dt) || { err_exit mktemp -dt failed; exit 1; }
43 then err_exit "${SHELL-ksh} -s not working"
51 then err_exit 'sh -e not working'
53 [[ $($SHELL -D -c 'print hi; print $"hello"') == '"hello"' ]] || err_exit 'ksh -D not working'
67 err_exit "\$ENV file &>/dev/null does not redirect stdout -- expected '', got $got"
73err_exit "\$ENV file &>/dev/null does not redirect stderr -- expected one diagnostic line, got $go…
81 err_exit 'privileged nointeractive shell reads $ENV file'
83 err_exit 'privileged -E reads $ENV file'
[all …]
H A Dbasic.sh20 function err_exit function
26 alias err_exit='err_exit $LINENO' alias
31 tmp=$(mktemp -dt) || { err_exit mktemp -dt failed; exit 1; }
53 [[ $g == $2 ]] || err_exit "umask 0; umask $1 failed -- expected $2, got $g"
56 umask u=rwx,go=rx || err_exit "umask u=rws,go=rx failed"
58 then err_exit 'umask -S incorrect'
62 cd $tmp || { err_exit "cd $tmp failed"; exit 1; }
67 [[ -r foobar ]] || err_exit 'umask not being restored after subshell'
82 then err_exit 'file expansion with trailing / not working'
85 then err_exit 'file expansion with single file not working'
[all …]
H A Dvariables.sh20 function err_exit function
26 alias err_exit='err_exit $LINENO' alias
31 tmp=$(mktemp -dt) || { err_exit mktemp -dt failed; exit 1; }
34 [[ ${.sh.version} == "$KSH_VERSION" ]] || err_exit '.sh.version != KSH_VERSION'
36 [[ ${@ss} ]] && err_exit '${@ss} should be empty string when ss is unset'
37 [[ ${!ss} == ss ]] || err_exit '${!ss} should be ss when ss is unset'
41 then err_exit RANDOM variable not working
46 then err_exit SECONDS variable not working
51 then err_exit _ variable not working
63 then err_exit PWD variable failed, not equivalent to .
[all …]
H A Dio.sh20 function err_exit function
26 alias err_exit='err_exit $LINENO' alias
31 tmp=$(mktemp -dt) || { err_exit mktemp -dt failed; exit 1; }
48 [[ $a == foo ]] || err_exit "bad file descriptor $i in comsub script"
51 [[ $(fun) == good ]] || err_exit 'file 3 closed before subshell completes'
53 cd $tmp || { err_exit "cd $tmp failed"; exit ; }
57 then err_exit 'append (>>) not working'
64 then err_exit "read on <> fd failed -- expected '$exp', got '$line'"
67 then err_exit 'noclobber not causing exclusive open'
91 …[[ $semantics == @(${FDFS[fdfs].semantics}) ]] || err_exit "'4< ${FDFS[fdfs].dir}/3' $semantics se…
[all …]
H A Dfunctions.sh20 function err_exit function
26 alias err_exit='err_exit $LINENO' alias
36 tmp=$(mktemp -dt) || { err_exit mktemp -dt failed; exit 1; }
59 then err_exit "command print not working inside print function"
64 then err_exit 'global variables not correct'
68 then err_exit '$0 not correct'
72 then err_exit 'environment override not correct'
75 then err_exit 'scoping error'
79 then err_exit non-local variables
84 then err_exit EXIT trap in wrong scope
[all …]
H A Dcomvar.sh20 function err_exit function
26 alias err_exit='err_exit $LINENO' alias
36 then err_exit 'compound variable not working'
40 then err_exit 'reference to compound object not working'
53 then err_exit 'copying a compound object not working'
56 then err_exit 'copying integer field of compound object not working'
66 then err_exit 'compound assignemnt of associative arrays not working'
73 then err_exit 'name references not expanded on prefix matching'
80 [[ ${x.foo.bar} == 7 ]] || err_exit '[[ ${x.foo.bar} != 7 ]]'
81 (( x.foo.bar == 7 ))|| err_exit '(( x.foo.bar != 7 ))'
[all …]
H A Dcubetype.sh20 function err_exit function
26 alias err_exit='err_exit $LINENO' alias
58 [[ "$got" == "$exp" ]] || err_exit "\${b.x} incorrect for iteration $i -- expected $exp, got '$got'"
60 (( got == exp )) || err_exit "b.len incorrect for iteration $i -- expected $exp, got '$got = sqrt($…
62 [[ "$got" == "$exp" ]] || err_exit "\${b.len} incorrect for iteration $i -- expected $exp, got '$go…
64 [[ "$got" == "${exp}" ]] || err_exit "\${b.name} incorrect for iteration $i -- expected $exp, got '…
66 (( got == exp )) || err_exit "b.count incorrect for iteration $i -- expected $exp, got '$got'"
68 [[ "$got" == "$exp" ]] || err_exit "\${b.ccount} incorrect for iteration $i -- expected $exp, got '…
72 [[ "$got" == "$exp" ]] || err_exit "\${#b.colors[@]} incorrect for iteration $i -- expected $exp, g…
94 [[ $b == "$bb" ]] || err_exit "\$b='$b' != \$bb='$bb'"
[all …]
H A Dcomvario.sh41 function err_exit function
47 alias err_exit='err_exit $LINENO' alias
177 } || err_exit "test returned exit code $?"
179 [[ "${s}" == "xhellox" ]] || err_exit "Expected 'xhellox', got ${s}"
180 count_brackets "$y" || err_exit "y: bracket open ${bracketstat.bopen} != bracket close ${bracketsta…
181 count_brackets "$(print -v y)" || err_exit "y: bracket open ${bracketstat.bopen} != bracket close $…
182 count_brackets "$(print -C y)" || err_exit "y: bracket open ${bracketstat.bopen} != bracket close $…
185 unset x y || err_exit "unset failed"
186 [[ "$x" == '' ]] || err_exit "cleanup failed for x"
187 [[ "$y" == '' ]] || err_exit "cleanup failed for y"
[all …]
H A Dpointtype.sh20 function err_exit function
26 alias err_exit='err_exit $LINENO' alias
43 [[ ${p.x} == 1 ]] || err_exit '${p[x]} is not 1'
45 [[ $(p.len) == 1 ]] || err_exit '$(p.len) != 1'
46 [[ ${p.len} == 1 ]] || err_exit '${p.len} != 1'
47 (( p.len == 1 )) || err_exit '((p.len != 1))'
49 (( q.x == 1 )) || err_exit 'q.x is not 1'
50 (( (q.len - sqrt(5)) < 10e-10 )) || err_exit 'q.len != sqrt(5)'
55 (( q.len == 3 )) || err_exit 'q.len is not 3'
57 [[ ${p.y} == 2 ]] || err_exit '${p[y]} is not 2'
[all …]
H A Dtypes.sh20 function err_exit function
26 alias err_exit='err_exit $LINENO' alias
31 tmp=$(mktemp -dt) || { err_exit mktemp -dt failed; exit 1; }
47 [[ $r == "$s" ]] || err_exit 'r is not equal to s'
53 [[ $y == "$z" ]] || err_exit 'y is not equal to z'
55 [[ $y == "${s.y}" ]] || err_exit 'y is not equal to s.y'
58 [[ $www == "$z" ]] || err_exit 'www is not equal to z'
60 [[ ${s.x} == "${r.x}" ]] || err_exit 's.x is not equal to r.x'
67 [[ $x == "$y" ]] || err_exit "x is not equal to y with ${!x}"
70 [[ $y == "${r.y}" ]] || err_exit 'y is not equal to r.y'
[all …]
H A Dpath.sh20 function err_exit function
26 alias err_exit='err_exit $LINENO' alias
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'
[all …]
H A Dreturn.sh22 function err_exit function
28 alias err_exit='err_exit $LINENO' alias
33 tmp=$(mktemp -dt) || { err_exit mktemp -dt failed; exit 1; }
66 [[ $foo == EXIT ]] || err_exit "foo "$@" : exit trap not set"
69 err_exit "foo $@: doesn't remove $file"
74 (exit 0) || err_exit "exit 0 is not zero"
75 (return 0) || err_exit "return 0 is not zero"
76 (exit) || err_exit "default exit value is not zero"
77 (return) || err_exit "default return value is not zero"
81 then err_exit "exit 35 is $ret not 35"
[all …]
H A Darrays2.sh20 function err_exit function
26 alias err_exit='err_exit $LINENO' alias
37 do [[ ${a[i][j]} == "$i$j" ]] || err_exit "\${a[$i][$j]} != $i$j"
42 do [[ $k == "$i$j" ]] || err_exit "\${a[i][@]} != $i$j"
62 do [[ ${a[$i][$j]} == "$i$j" ]] || err_exit "\${$c[$i][$j]} != $i$j"
69 [[ ${@} == '0 1 2 3' ]] || err_exit "\${!$c[@]} not 0 1 2 3"
71 [[ ${@} == '0 1 2 3 4' ]] || err_exit "\${!$c[0][@]} not 0 1 2 3 4"
73 [[ ${@} == '0 1 2 3 4 5' ]] || err_exit "\${!$c[1][@]} not 0 1 2 3 4 5"
74 [[ $a == 00 ]] || err_exit "\$$c is not 00"
75 [[ ${a[0]} == 00 ]] || err_exit "\${$a[0]} is not 00"
[all …]
H A Dalias.sh20 function err_exit function
26 alias err_exit='err_exit $LINENO' alias
31 tmp=$(mktemp -dt) || { err_exit mktemp -dt failed; exit 1; }
36 then err_exit 'foo, where foo is alias for "print hello" failed'
39 then err_exit 'foo world, where foo is alias for "print hello" failed'
44 then err_exit 'foo bar, where foo is alias for "print hello " failed'
47 then err_exit 'foo \bar, where foo is alias for "print hello " failed'
51 then err_exit 'bar, where bar is alias for "foo world" failed'
54 then err_exit 'alias bar, where bar is alias for "foo world" failed'
56 unalias foo || err_exit "unalias foo failed"
[all …]
/illumos-gate/usr/src/cmd/ast/libshell/common/tests/
H A Dsun_solaris_builtin_sum.sh32 function err_exit function
38 alias err_exit='err_exit $LINENO' alias
47 builtin sum || err_exit "sum builtin not found"
50 x="$(print 'hello' | /usr/bin/sum)" || err_exit "/usr/bin/sum pipe failed."
51 [[ "$x" == "542 1" ]] || err_exit "print 'hello' | /usr/bin/sum did not return 542 1, got $x"
52 x="$(print 'hello' | sum)" || err_exit "sum builtin pipe failed."
53 [[ "$x" == "542 1" ]] || err_exit "print 'hello' | sum builtin did not return 542 1, got $x"
54 x="$(print 'hello' | sum -x md5)" || err_exit "sum md5 builtin pipe failed."
55 [[ "$x" == "b1946ac92492d2347c6235b4d2611184" ]] || err_exit "print 'hello' | sum md5 builtin did n…
56 x="$(print 'hello' | sum -x sha1)" || err_exit "sum sha1 builtin pipe failed."
[all …]
H A Dsun_solaris_compound_misc.sh33 function err_exit function
39 alias err_exit='err_exit $LINENO' alias
76 tmpdir="$(mktemp -t -d "test_sun_solaris_compound_misc.XXXXXXXX")" || err_exit "Cannot create tempo…
78 cd "${tmpdir}" || { err_exit "cd ${tmpdir} failed." ; exit $((Errors)) ; }
93 [[ "$cx" == "$cy" ]] || err_exit "'$cx' != '$cy'"
94 [[ "$cx" == "$cz" ]] || err_exit "'$cx' != '$cz'"
95 [[ "$cy" == "$cz" ]] || err_exit "'$cy' != '$cz'"
97 count_brackets "$cx" || err_exit "Brackets not balanced for '$cx'"
98 count_brackets "$cy" || err_exit "Brackets not balanced for '$cy'"
99 count_brackets "$cz" || err_exit "Brackets not balanced for '$cz'"
[all …]
H A Dsun_solaris_compoundvario.sh27 function err_exit function
33 alias err_exit='err_exit $LINENO' alias
158 } || err_exit "test returned exit code $?"
160 [[ "${s}" == "xhellox" ]] || err_exit "Expected 'xhellox', got ${s}"
161 count_brackets "$y" || err_exit "y: bracket open ${bracketstat.bopen} != bracket close ${bracketsta…
162 count_brackets "$(print -v y)" || err_exit "y: bracket open ${bracketstat.bopen} != bracket close $…
163 count_brackets "$(print -C y)" || err_exit "y: bracket open ${bracketstat.bopen} != bracket close $…
166 unset x y || err_exit "unset failed"
167 [[ "$x" == "" ]] || err_exit "cleanup failed for x"
168 [[ "$y" == "" ]] || err_exit "cleanup failed for y"
[all …]
H A Dsun_solaris_array_default_datatype.sh34 function err_exit function
40 alias err_exit='err_exit $LINENO' alias
171 err_exit "${cycle}: Should not happen."
180 …(( mycpv.myindexedfloatarray[34] == 1.1 )) || err_exit "${cycle}: mycpv.myindexedfloatarray[34] ==…
182 …(( mycpv.myindexedfloatarray[34] == 2.2 )) || err_exit "${cycle}: mycpv.myindexedfloatarray[34] ==…
184 …(( mycpv.myindexedfloatarray[34] == 0.0 )) || err_exit "${cycle}: mycpv.myindexedfloatarray[34] ==…
188 …(( mycpv.myindexedfloatarray[34] == 1.1 )) || err_exit "${cycle}: mycpv.myindexedfloatarray[34] ==…
190 …(( mycpv.myindexedfloatarray[34] == 2.2 )) || err_exit "${cycle}: mycpv.myindexedfloatarray[34] ==…
192 …(( mycpv.myindexedfloatarray[34] == 0.0 )) || err_exit "${cycle}: mycpv.myindexedfloatarray[34] ==…
199 …(( mycpv.myassociativefloatarray[34] == 1.1 )) || err_exit "${cycle}: mycpv.myassociativefloatarra…
[all …]
H A Dsun_solaris_cr_6713682_compound_var_bleeds_through_subshell.sh54 function err_exit function
60 alias err_exit='err_exit $LINENO' alias
70 …et l ; ( l=( a=1 b="BE" ) ; print "$l" ) ; print $l')" || err_exit "Non-zero exit co…
71 …et l ; ( ulimit -c 0 ; l=( a=1 b="BE" ) ; print "$l" ) ; print $l')" || err_exit "Non-zero exit co…
72 [[ "${var1}" == "${var2}" ]] || err_exit "Non-fork()'ed subshell output differes from fork()'ed sub…
75 var1="$(${SHELL} -c '( l=( a=1 b="BE" ) ; print "$l" ) ; print $l')" || err_exit "Non…
76 var2="$(${SHELL} -c '( ulimit -c 0 ; l=( a=1 b="BE" ) ; print "$l" ) ; print $l')" || err_exit "Non…
77 [[ "${var1}" == "${var2}" ]] || err_exit "Non-fork()'ed subshell output differes from fork()'ed sub…
80 … compound l ; l.a=1 ; l.b="BE" ; print "$l" ) ; print $l')" || err_exit "Non-zero exit co…
81 …it -c 0 ; compound l ; l.a=1 ; l.b="BE" ; print "$l" ) ; print $l')" || err_exit "Non-zero exit co…
[all …]
H A Dillumos_4149_builtin_head.sh22 function err_exit function
28 alias err_exit='err_exit $LINENO' alias
56 err_exit "Shell head -1 standard file"
59 err_exit "Shell head -2 standard file"
62 err_exit "Shell head -s 2 -n 2 standard file"
65 err_exit "Shell head -5 standard file"
68 err_exit "Shell head -10 standard file"
71 err_exit "Shell tail -1 standard file"
74 err_exit "Shell tail -2 standard file"
77 err_exit "Shell tail -10 standard file"
[all …]

12345