/ast/src/cmd/ksh93/tests/ |
H A D | bracket.sh | 20 function err_exit function 26 alias err_exit='err_exit $LINENO' 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 " [all...] |
H A D | restricted.sh | 20 function err_exit function 26 alias err_exit='err_exit $LINENO' 31 tmp=$(mktemp -dt) || { err_exit mktemp -dt failed; exit 1; } 49 cd $tmp || err_exit "cd $tmp failed" 52 rksh -c '[[ -o restricted ]]' || err_exit 'restricted option not set' 53 [[ $(rksh -c 'print hello') == hello ]] || err_exit 'unable to run print' 54 check_restricted /bin/echo || err_exit '/bin/echo not resticted' 55 check_restricted ./echo || err_exit './echo not resticted' 56 check_restricted 'SHELL=ksh' || err_exit 'SHEL [all...] |
H A D | return.sh | 22 function err_exit function 28 alias err_exit='err_exit $LINENO' 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 "defaul [all...] |
H A D | quoting.sh | 20 function err_exit function 26 alias err_exit='err_exit $LINENO' 31 then err_exit "single quotes not the same as double quotes" 35 then err_exit "$x not the same as 'hi there'" 38 then err_exit "$x not the same as \"hi there \"" 41 then err_exit " \\ differs from '' " 44 then err_exit " \"\" differs from '' " 47 then err_exit "\$(print -r - '') differs from ''" 50 then err_exit "\ [all...] |
H A D | timetype.sh | 20 function err_exit function 26 alias err_exit='err_exit $LINENO' 50 [[ $t == "$d" ]] || err_exit "printf %T != Time_t -- expected '$d', got '$t'" 51 (( t == s )) || err_exit "numeric Time_t failed -- expected '$s', got '$t'" 53 [[ $t == $s ]] || err_exit "t._='%#' failed -- expected '$s', got '$t'" 57 [[ ${!tt[@]} == '0 1 2 3' ]] || err_exit "indexed array subscript names failed -- expected '0 1 2 3', got '${!tt[@]}'" 58 [[ ${tt[0]} == *+00:00 ]] || err_exit "tt[0] failed -- expected 00:00, got '${tt[0]##*+}'" 59 [[ ${tt[1]} == *+00:00 ]] || err_exit "tt[1] failed -- expected 00:00, got '${tt[1]##*+}'" 60 [[ ${tt[2]} == *+00:00 ]] || err_exit "t [all...] |
H A D | arith.sh | 20 function err_exit function 26 alias err_exit='err_exit $LINENO' 31 tmp=$(mktemp -dt) || { err_exit mktemp -dt failed; exit 1; } 38 then err_exit 2+2!=4 41 then err_exit x+y!=z 44 then err_exit $x+$y!=$z 47 then err_exit "(x|y)!=z" 50 then err_exit "y>=z" 53 then err_exit " [all...] |
H A D | enum.sh | 20 function err_exit function 26 alias err_exit='err_exit $LINENO' 35 [[ $x == red ]] || err_exit 'Color_t does not default to red' 37 [[ $x == orange ]] || err_exit '$x should be orange' 38 ( x=violet) 2> /dev/null && err_exit 'x=violet should fail' 40 [[ ${x[2]} == green ]] || err_exit '${x[2]} should be green' 41 (( x[2] == 1 )) || err_exit '((x[2]!=1))' 42 [[ $((x[2])) == 1 ]] || err_exit '$((x[2]))!=1' 43 [[ $x == orange ]] || err_exit ' [all...] |
H A D | alias.sh | 20 function err_exit function 26 alias err_exit='err_exit $LINENO' 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 'alia [all...] |
H A D | quoting2.sh | 20 function err_exit function 26 alias err_exit='err_exit $LINENO' 32 then err_exit "single quotes not the same as double quotes" 36 then err_exit "$x not the same as 'hi there'" 39 then err_exit "$x not the same as \"hi there \"" 42 then err_exit " \\ differs from '' " 45 then err_exit " \"\" differs from '' " 48 then err_exit "\$(print -r - '') differs from ''" 51 then err_exit "\ [all...] |
H A D | sigchld.sh | 20 function err_exit function 27 alias err_exit='err_exit $LINENO' 58 ') || err_exit "test loop failed" 62 (( foreground == FOREGROUND )) || err_exit "expected '$FOREGROUND foreground' -- got '$foreground' (DELAY=$DELAY)" 63 (( background == BACKGROUND )) || err_exit "expected '$BACKGROUND background' -- got '$background' (DELAY=$DELAY)" 85 [[ $got == $exp ]] || err_exit "SIGCHLD trap queueing failed -- expected '$exp', got '$got'" 109 [[ $got == $exp ]] || err_exit "SIGCHLD trap queueing failed -- expected $(printf %q "$exp"), got $(printf %q "$got")" 117 [[ $got == good ]] || err_exit 'SIGCLD handler effects read behavior' 130 then err_exit "CHL [all...] |
H A D | select.sh | 20 function err_exit function 26 alias err_exit='err_exit $LINENO' 31 tmp=$(mktemp -dt) || { err_exit mktemp -dt failed; exit 1; } 45 *) err_exit "select 1 not working" 55 foo) err_exit "select foo not working" 2>&3 58 then err_exit "select REPLY not correct" 2>&3 60 ( set -u; : $i ) || err_exit "select: i not set to null" 2>&3
|
H A D | attributes.sh | 20 function err_exit function 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 referenc [all...] |
H A D | namespace.sh | 20 function err_exit function 26 alias err_exit='err_exit $LINENO' 31 tmp=$(mktemp -dt) || { err_exit mktemp -dt failed; exit 1; } 75 [[ $(fn) == 'local fn bar' ]] || err_exit 'fn inside namespace should run local function' 76 [[ $(fun) == 'global fun abc' ]] || err_exit 'global fun run from namespace not working' 77 (( r == 9 )) || err_exit 'global variable r not set in namespace' 79 [[ ${z[qqq]} == abc ]] || err_exit 'local array element not correct' 80 [[ ${z[abc]} == '' ]] || err_exit 'global array element should not be visible when local element exists' 81 [[ ${bar.y} == 2 ]] || err_exit 'loca [all...] |
H A D | basic.sh | 20 function err_exit function 26 alias err_exit='err_exit $LINENO' 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 'fil [all...] |
H A D | options.sh | 20 function err_exit function 26 alias err_exit='err_exit $LINENO' 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" 73 err_exit "\$ENV file &>/dev/null does not redirect stderr -- expected one diagnostic line, got $got" 81 err_exit 'privilege [all...] |
H A D | pointtype.sh | 20 function err_exit function 26 alias err_exit='err_exit $LINENO' 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 ' [all...] |
H A D | arrays.sh | 20 function err_exit function 26 alias err_exit='err_exit $LINENO' 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 ' [all...] |
H A D | builtins.sh | 20 function err_exit function 26 alias err_exit='err_exit $LINENO' 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" 39 [[ $# == 2 && $1 == - && $2 == foobar ]] || err_exit "set -- - foobar failed" 41 [[ $# == 2 && $1 == -x && $2 == foobar ]] || err_exit "set -- -x foobar failed" 42 getopts :x: foo || err_exit "getopts :x: returns false" 43 [[ $foo == x && $OPTARG == foobar ]] || err_exit "getopt [all...] |
H A D | tilde.sh | 20 function err_exit function 26 alias err_exit='err_exit $LINENO' 31 tmp=$(mktemp -dt) || { err_exit mktemp -dt failed; exit 1; } 36 [[ $x == ~root ]] || err_exit '~user expanded in subshell prevent ~user from working' 52 then err_exit '~' not $HOME 56 then err_exit x=~ not $HOME 60 then err_exit x=x:~ not x:$HOME 63 then err_exit '~' not $PWD 67 then err_exit [all...] |
H A D | substring.sh | 20 function err_exit function 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 "string [all...] |
H A D | case.sh | 20 function err_exit function 26 alias err_exit='err_exit $LINENO' 46 then err_exit "$i not matching correct pattern" 52 *) err_exit "$f does not match \[*\]";; 62 then err_exit 'case abc {...} not working' 67 esac') != b ]] && err_exit 'bug in ;& at end of script' 80 ') == foo.h ]] || err_exit "optimizer bug" 83 [[ $x == 1 ]] || err_exit 'set -e ignored on case fail through'
|
H A D | io.sh | 20 function err_exit function 26 alias err_exit='err_exit $LINENO' 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 'noclobbe [all...] |
H A D | cubetype.sh | 20 function err_exit function 26 alias err_exit='err_exit $LINENO' 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(${b.x}*${b.x}+${b.y}*${b.y})'" 62 [[ "$got" == "$exp" ]] || err_exit "\${b.len} incorrect for iteration $i -- expected $exp, got '$got = sqrt(${b.x}*${b.x}+${b.y}*${b.y})'" 64 [[ "$got" == "${exp}" ]] || err_exit "\${b.name} incorrect for iteration $i -- expected $exp, got '$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 '$got'" 72 [[ "$got" == "$exp" ]] || err_exit "\ [all...] |
H A D | append.sh | 20 function err_exit function 26 alias err_exit='err_exit $LINENO' 34 then err_exit 'abc+def != abcdef' 39 then err_exit '3+4!=7' 44 then err_exit 'index array append fails' 50 then err_exit 'index array append to scalar fails' 56 then err_exit 'associative array append fails' 59 then err_exit 'number of elements of associative array append fails' 64 then err_exit 'compoun [all...] |
H A D | functions.sh | 20 function err_exit function 26 alias err_exit='err_exit $LINENO' 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 no [all...] |