summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChet Ramey <chet.ramey@case.edu>2011-12-03 13:04:22 -0500
committerChet Ramey <chet.ramey@case.edu>2011-12-03 13:04:22 -0500
commit0e5ad4671a0f319a6b1046e452a15078fcfc56b5 (patch)
treec7b433425d9638e9d787cb1090aee2aa0e08858f /tests
parent761783bf6ce6e3898bde7c0cb0a585c3adc9eb35 (diff)
downloadbash-0e5ad4671a0f319a6b1046e452a15078fcfc56b5.tar.gz
bash-3.0 cleanup of extra files
Diffstat (limited to 'tests')
-rwxr-xr-xtests/RUN-ONE-TEST~9
-rw-r--r--tests/arith.tests~281
-rw-r--r--tests/cprint.right.save172
-rwxr-xr-xtests/dollar-at-star~218
-rw-r--r--tests/dollar-at1.sub~29
-rw-r--r--tests/errors.right~100
-rw-r--r--tests/exec.right~53
-rw-r--r--tests/execscript~105
-rw-r--r--tests/histexp.right~129
-rw-r--r--tests/history.tests.save97
-rw-r--r--tests/jobs.right~97
-rw-r--r--tests/jobs.tests~179
-rw-r--r--tests/misc/regress/log.orig50
-rw-r--r--tests/misc/regress/shx.orig10
-rw-r--r--tests/read.tests~92
-rw-r--r--tests/trap.tests~86
16 files changed, 0 insertions, 1607 deletions
diff --git a/tests/RUN-ONE-TEST~ b/tests/RUN-ONE-TEST~
deleted file mode 100755
index 3efcf32d..00000000
--- a/tests/RUN-ONE-TEST~
+++ /dev/null
@@ -1,9 +0,0 @@
-BUILD_DIR=/usr/local/build/chet/bash/bash-current
-THIS_SH=$BUILD_DIR/bash
-PATH=$PATH:$BUILD_DIR
-
-export THIS_SH PATH
-
-rm -f /tmp/xx
-
-/bin/sh "$@"
diff --git a/tests/arith.tests~ b/tests/arith.tests~
deleted file mode 100644
index ce6a372a..00000000
--- a/tests/arith.tests~
+++ /dev/null
@@ -1,281 +0,0 @@
-set +o posix
-declare -i iv jv
-
-iv=$(( 3 + 5 * 32 ))
-echo $iv
-iv=iv+3
-echo $iv
-iv=2
-jv=iv
-
-let "jv *= 2"
-echo $jv
-jv=$(( $jv << 2 ))
-echo $jv
-
-let jv="$jv / 2"
-echo $jv
-jv="jv >> 2"
-echo $jv
-
-iv=$((iv+ $jv))
-echo $iv
-echo $((iv -= jv))
-echo $iv
-echo $(( iv == jv ))
-echo $(( iv != $jv ))
-echo $(( iv < jv ))
-echo $(( $iv > $jv ))
-echo $(( iv <= $jv ))
-echo $(( $iv >= jv ))
-
-echo $jv
-echo $(( ~$jv ))
-echo $(( ~1 ))
-echo $(( ! 0 ))
-
-echo $(( jv % 2 ))
-echo $(( $iv % 4 ))
-
-echo $(( iv <<= 16 ))
-echo $(( iv %= 33 ))
-
-echo $(( 33 & 55 ))
-echo $(( 33 | 17 ))
-
-echo $(( iv && $jv ))
-echo $(( $iv || jv ))
-
-echo $(( iv && 0 ))
-echo $(( iv & 0 ))
-echo $(( iv && 1 ))
-echo $(( iv & 1 ))
-
-echo $(( $jv || 0 ))
-echo $(( jv | 0 ))
-echo $(( jv | 1 ))
-echo $(( $jv || 1 ))
-
-let 'iv *= jv'
-echo $iv
-echo $jv
-let "jv += $iv"
-echo $jv
-
-echo $(( jv /= iv ))
-echo $(( jv <<= 8 ))
-echo $(( jv >>= 4 ))
-
-echo $(( iv |= 4 ))
-echo $(( iv &= 4 ))
-
-echo $(( iv += (jv + 9)))
-echo $(( (iv + 4) % 7 ))
-
-# unary plus, minus
-echo $(( +4 - 8 ))
-echo $(( -4 + 8 ))
-
-# conditional expressions
-echo $(( 4<5 ? 1 : 32))
-echo $(( 4>5 ? 1 : 32))
-echo $(( 4>(2+3) ? 1 : 32))
-echo $(( 4<(2+3) ? 1 : 32))
-echo $(( (2+2)<(2+3) ? 1 : 32))
-echo $(( (2+2)>(2+3) ? 1 : 32))
-
-# check that the unevaluated part of the ternary operator does not do
-# evaluation or assignment
-x=i+=2
-y=j+=2
-declare -i i=1 j=1
-echo $((1 ? 20 : (x+=2)))
-echo $i,$x
-echo $((0 ? (y+=2) : 30))
-echo $j,$y
-
-x=i+=2
-y=j+=2
-declare -i i=1 j=1
-echo $((1 ? 20 : (x+=2)))
-echo $i,$x
-echo $((0 ? (y+=2) : 30))
-echo $i,$y
-
-# check precedence of assignment vs. conditional operator
-# should be an error
-declare -i x=2
-y=$((1 ? 20 : x+=2))
-
-# check precedence of assignment vs. conditional operator
-declare -i x=2
-echo $((0 ? x+=2 : 20))
-
-# associativity of assignment-operator operator
-declare -i i=1 j=2 k=3
-echo $((i += j += k))
-echo $i,$j,$k
-
-# octal, hex
-echo $(( 0x100 | 007 ))
-echo $(( 0xff ))
-echo $(( 16#ff ))
-echo $(( 16#FF/2 ))
-echo $(( 8#44 ))
-
-echo $(( 8 ^ 32 ))
-
-# other bases
-echo $(( 16#a ))
-echo $(( 32#a ))
-echo $(( 56#a ))
-echo $(( 64#a ))
-
-echo $(( 16#A ))
-echo $(( 32#A ))
-echo $(( 56#A ))
-echo $(( 64#A ))
-
-echo $(( 64#@ ))
-echo $(( 64#_ ))
-
-# weird bases
-echo $(( 3425#56 ))
-
-# missing number after base
-echo $(( 2# ))
-
-# these should generate errors
-echo $(( 7 = 43 ))
-echo $(( 2#44 ))
-echo $(( 44 / 0 ))
-let 'jv += $iv'
-echo $(( jv += \$iv ))
-let 'rv = 7 + (43 * 6'
-
-# more errors
-declare -i i
-i=0#4
-i=2#110#11
-
-((echo abc; echo def;); echo ghi)
-
-if (((4+4) + (4 + 7))); then
- echo ok
-fi
-
-(()) # make sure the null expression works OK
-
-a=(0 2 4 6)
-echo $(( a[1] + a[2] ))
-echo $(( (a[1] + a[2]) == a[3] ))
-(( (a[1] + a[2]) == a[3] )) ; echo $?
-
-# test pushing and popping the expression stack
-unset A
-A="4 + "
-echo $(( ( 4 + A ) + 4 ))
-A="3 + 5"
-echo $(( ( 4 + A ) + 4 ))
-
-# badly-formed conditional expressions
-echo $(( 4 ? : $A ))
-echo $(( 1 ? 20 ))
-echo $(( 4 ? 20 : ))
-
-# precedence and short-circuit evaluation
-B=9
-echo $B
-
-echo $(( 0 && B=42 ))
-echo $B
-
-echo $(( 1 || B=88 ))
-echo $B
-
-echo $(( 0 && (B=42) ))
-echo $B
-
-echo $(( (${$} - $$) && (B=42) ))
-echo $B
-
-echo $(( 1 || (B=88) ))
-echo $B
-
-# until command with (( )) command
-x=7
-
-echo $x
-until (( x == 4 ))
-do
- echo $x
- x=4
-done
-
-echo $x
-
-# exponentiation
-echo $(( 2**15 - 1))
-echo $(( 2**(16-1)))
-echo $(( 2**16*2 ))
-echo $(( 2**31-1))
-echo $(( 2**0 ))
-
-# {pre,post}-{inc,dec}rement and associated errors
-
-x=4
-
-echo $x
-echo $(( x++ ))
-echo $x
-echo $(( x-- ))
-echo $x
-
-echo $(( --x ))
-echo $x
-
-echo $(( ++x ))
-echo $x
-
-echo $(( ++7 ))
-echo $(( 7-- ))
-
-echo $(( --x=7 ))
-echo $(( ++x=7 ))
-
-echo $(( x++=7 ))
-echo $(( x--=7 ))
-
-echo $x
-
-echo $(( +7 ))
-echo $(( -7 ))
-
-echo $(( ++7 ))
-echo $(( --7 ))
-
-x=4
-y=7
-
-(( x=8 , y=12 ))
-
-echo $x $y
-
-# should be an error
-(( x=9 y=41 ))
-
-# These are errors
-unset b
-echo $((a b))
-((a b))
-
-n=42
-printf "%d\n" $n
-printf "%i\n" $n
-echo $(( 8#$(printf "%o\n" $n) ))
-printf "%u\n" $n
-echo $(( 16#$(printf "%x\n" $n) ))
-echo $(( 16#$(printf "%X\n" $n) ))
-
-# causes longjmp botches through bash-2.05b
-a[b[c]d]=e
diff --git a/tests/cprint.right.save1 b/tests/cprint.right.save1
deleted file mode 100644
index 6b711b8c..00000000
--- a/tests/cprint.right.save1
+++ /dev/null
@@ -1,72 +0,0 @@
-tf is a function
-tf ()
-{
- echo this is ${0##*/} >/dev/null;
- echo a | cat - >/dev/null;
- test -f ${0##*/} && echo ${0##*/} is a regular file;
- test -d ${0##*/} || echo ${0##*/} is not a directory;
- echo a;
- echo b;
- echo c;
- echo background >/dev/null & ( exit 1 );
- echo $?;
- {
- echo a
- };
- i=0;
- while (( " i < 3 " )); do
- test -r /dev/fd/$i;
- i=$(( i + 1 ));
- done;
- [[ -r /dev/fd/0 && -w /dev/fd/1 ]] || echo oops >/dev/null;
- for name in $( echo 1 2 3 );
- do
- test -r /dev/fd/$name;
- done;
- if [[ -r /dev/fd/0 && -w /dev/fd/1 ]]; then
- echo ok >/dev/null;
- else
- if (( " 7 > 40 " )); then
- echo oops;
- else
- echo done;
- fi;
- fi >/dev/null;
- case $PATH in
- *$PWD*)
- echo \$PWD in \$PATH
- ;;
- *)
- echo \$PWD not in \$PATH
- ;;
- esac >/dev/null;
- while false; do
- echo z;
- done >/dev/null;
- until true; do
- echo z;
- done >/dev/null;
- echo \&\|'()' \{ echo abcde \; \};
- eval fu\%nc'()' \{ echo abcde \; \};
- type fu\%nc
-}
-tf2 is a function
-tf2 ()
-{
- ( {
- time -p echo a | cat - >/dev/null
- } ) 2>&1
-}
-cprint.tests is a regular file
-cprint.tests is not a directory
-a
-b
-c
-1
-a
-&|() { echo abcde ; }
-fu%nc is a function
-fu%nc ()
-{
- echo abcde
-}
diff --git a/tests/dollar-at-star~ b/tests/dollar-at-star~
deleted file mode 100755
index 7b6d75ae..00000000
--- a/tests/dollar-at-star~
+++ /dev/null
@@ -1,218 +0,0 @@
-# first, let's start with the basics
-
-recho "$@"
-recho "$*"
-
-recho $@
-recho $*
-
-set a b
-
-recho "$*"
-
-# If IFS is null, the parameters are joined without separators
-IFS=''
-recho "$*"
-
-# If IFS is unset, the parameters are separated by spaces
-unset IFS
-recho "${*}"
-
-recho "$@"
-recho $@
-
-IFS='/'
-set bob 'tom dick harry' joe
-set $*
-recho $#
-recho $1
-recho $2
-recho $3
-
-set bob 'tom dick harry' joe
-set ${*}
-recho $#
-recho $1
-recho $2
-recho $3
-
-set bob 'tom dick harry' joe
-set $@
-recho $#
-recho $1
-recho $2
-recho $3
-
-set bob 'tom dick harry' joe
-set ${@}
-recho $#
-recho $1
-recho $2
-recho $3
-
-# according to POSIX.2, unquoted $* should expand to multiple words if
-# $IFS is null, just like unquoted $@
-IFS=''
-set bob 'tom dick harry' joe
-set $*
-recho $#
-recho $1
-recho $2
-recho $3
-
-set bob 'tom dick harry' joe
-set $@
-recho $#
-recho $1
-recho $2
-recho $3
-
-# if IFS is unset, the individual positional parameters are split on
-# " \t\n" if $* or $@ are unquoted
-unset IFS
-set bob 'tom dick harry' joe
-set $*
-recho $#
-recho $1
-recho $2
-recho $3
-
-set bob 'tom dick harry' joe
-set $@
-recho $#
-recho $1
-recho $2
-recho $3
-
-# but not for "$@" or "$*"
-set bob 'tom dick harry' joe
-set "$*"
-recho $#
-recho $1
-recho $2
-recho $3
-
-set bob 'tom dick harry' joe
-set "$@"
-recho $#
-recho $1
-recho $2
-recho $3
-
-# POSIX.2 says these should both expand the positional parameters
-# to multiple words
-set a b c d e
-IFS=""
-recho $@
-recho "$@"
-
-# this example is straight from the POSIX.2 rationale
-set foo bar bam
-
-recho "$@"
-recho "$*"
-
-unset IFS
-
-recho "$@"
-recho $@
-recho "$*"
-
-IFS=:
-
-# special variables
-set -- 1 2 3 4 5 6 7 8 9 10
-
-bar=${*}
-foo=$*
-echo foo = "$foo"
-echo bar = "$bar"
-
-foo1=$@
-bar1=${@}
-
-echo foo1 = "$foo1"
-echo bar1 = "$bar1"
-
-foo2="$*"
-bar2="${*}"
-
-echo foo2 = "$foo2"
-echo bar2 = "$bar2"
-
-eval foo3='$*' bar3='${*}'
-echo foo3 = "$foo3"
-echo bar3 = "$bar3"
-
-case $* in
-*\:*) echo ok 1;;
-*) echo bad 1;;
-esac
-
-case $@ in
-*\:*) echo bad 2;;
-*) echo ok 2;;
-esac
-
-case "$*" in
-*\:*) echo ok 3;;
-*) echo bad 3;;
-esac
-
-case "$@" in
-*\:*) echo bad 4;;
-*) echo ok 4;;
-esac
-
-IFS=$' \t\n'
-
-bar=${*}
-foo=$*
-echo foo = "$foo"
-echo bar = "$bar"
-
-foo1=$@
-bar1=${@}
-
-echo foo1 = "$foo1"
-echo bar1 = "$bar1"
-
-foo2="$*"
-bar2="${*}"
-
-echo foo2 = "$foo2"
-echo bar2 = "$bar2"
-
-eval foo3='$*' bar3='${*}'
-echo foo3 = "$foo3"
-echo bar3 = "$bar3"
-
-case $* in
-*\ *) echo ok 1;;
-*) echo bad 1;;
-esac
-
-case $@ in
-*\ *) echo ok 2;;
-*) echo bad 2;;
-esac
-
-case "$*" in
-*\ *) echo ok 3;;
-*) echo bad 3;;
-esac
-
-case "$@" in
-*\ *) echo ok 4;;
-*) echo bad 4;;
-esac
-
-# tests for special expansion of "$*" and "${array[*]}" when used with other
-# expansions -- bugs through bash-2.05b
-${THIS_SH} ./dollar-star1.sub
-
-# tests for expansion of "$@" on rhs of things like ${param:+word}. Bugs
-# though bash-2.05b
-${THIS_SH} ./dollar-at1.sub
-
-exit 0
diff --git a/tests/dollar-at1.sub~ b/tests/dollar-at1.sub~
deleted file mode 100644
index 45f7cc56..00000000
--- a/tests/dollar-at1.sub~
+++ /dev/null
@@ -1,29 +0,0 @@
-echo_argc()
-{
- echo $#
-}
-
-a()
-{
- shift
- echo_argc "$@"
- echo_argc ${1:+"$@"}
- echo_argc "${1:+$@}"
- echo_argc 1 2 3
-}
-
-b()
-{
- _IFS="$IFS"
- IFS="$1"
- shift
- echo_argc "$@"
- echo_argc ${1:+"$@"}
- echo_argc "${1:+$@}"
- echo_argc 1 2 3
- IFS="$_IFS"
-}
-
-#a "X" foo bar hoge
-#echo
-b "X" foo bar hoge
diff --git a/tests/errors.right~ b/tests/errors.right~
deleted file mode 100644
index 1f3487be..00000000
--- a/tests/errors.right~
+++ /dev/null
@@ -1,100 +0,0 @@
-./errors.tests: line 17: alias: -x: invalid option
-alias: usage: alias [-p] [name[=value] ... ]
-./errors.tests: line 18: unalias: -x: invalid option
-unalias: usage: unalias [-a] name [name ...]
-./errors.tests: line 19: alias: hoowah: not found
-./errors.tests: line 20: unalias: hoowah: not found
-./errors.tests: line 23: `1': not a valid identifier
-declare -fr func
-./errors.tests: line 36: func: readonly function
-./errors.tests: line 39: unset: -x: invalid option
-unset: usage: unset [-f] [-v] [name ...]
-./errors.tests: line 42: unset: func: cannot unset: readonly function
-./errors.tests: line 45: declare: func: readonly function
-./errors.tests: line 49: unset: XPATH: cannot unset: readonly variable
-./errors.tests: line 52: unset: `/bin/sh': not a valid identifier
-./errors.tests: line 55: unset: cannot simultaneously unset a function and a variable
-./errors.tests: line 58: declare: -z: invalid option
-declare: usage: declare [-afFirtx] [-p] [name[=value] ...]
-./errors.tests: line 60: declare: `-z': not a valid identifier
-./errors.tests: line 61: declare: `/bin/sh': not a valid identifier
-./errors.tests: line 65: declare: cannot use `-f' to make functions
-./errors.tests: line 68: exec: -i: invalid option
-exec: usage: exec [-cl] [-a name] file [redirection ...]
-./errors.tests: line 72: export: XPATH: not a function
-./errors.tests: line 75: break: only meaningful in a `for', `while', or `until' loop
-./errors.tests: line 76: continue: only meaningful in a `for', `while', or `until' loop
-./errors.tests: line 79: shift: label: numeric argument required
-./errors.tests: line 84: shift: too many arguments
-./errors.tests: line 90: let: expression expected
-./errors.tests: line 93: local: can only be used in a function
-./errors.tests: line 96: logout: not login shell: use `exit'
-./errors.tests: line 99: hash: notthere: not found
-./errors.tests: line 102: hash: -v: invalid option
-hash: usage: hash [-lr] [-p pathname] [-dt] [name ...]
-./errors.tests: line 106: hash: hashing disabled
-./errors.tests: line 109: export: `AA[4]': not a valid identifier
-./errors.tests: line 110: readonly: `AA[4]': not a valid identifier
-./errors.tests: line 113: [-2]: bad array subscript
-./errors.tests: line 117: AA: readonly variable
-./errors.tests: line 121: AA: readonly variable
-./errors.tests: line 129: shift: 5: shift count out of range
-./errors.tests: line 130: shift: -2: shift count out of range
-./errors.tests: line 133: shopt: no_such_option: invalid shell option name
-./errors.tests: line 134: shopt: no_such_option: invalid shell option name
-./errors.tests: line 137: umask: 09: octal number out of range
-./errors.tests: line 138: umask: `:': invalid symbolic mode character
-./errors.tests: line 139: umask: `:': invalid symbolic mode operator
-./errors.tests: line 142: umask: -i: invalid option
-umask: usage: umask [-p] [-S] [mode]
-./errors.tests: line 146: umask: `u': invalid symbolic mode character
-./errors.tests: line 155: VAR: readonly variable
-./errors.tests: line 158: declare: VAR: readonly variable
-./errors.tests: line 159: declare: VAR: readonly variable
-./errors.tests: line 161: declare: unset: not found
-./errors.tests: line 164: VAR: readonly variable
-./errors.tests: command substitution: line 168: syntax error: unexpected end of file
-./errors.tests: command substitution: line 168: syntax error near unexpected token `done'
-./errors.tests: command substitution: line 168: ` for z in 1 2 3; done '
-./errors.tests: line 171: cd: HOME not set
-./errors.tests: line 172: cd: /tmp/xyz.bash: No such file or directory
-./errors.tests: line 174: cd: OLDPWD not set
-./errors.tests: line 175: cd: /bin/sh: Not a directory
-./errors.tests: line 177: cd: /tmp/cd-notthere: No such file or directory
-./errors.tests: line 180: .: filename argument required
-.: usage: . filename [arguments]
-./errors.tests: line 181: source: filename argument required
-source: usage: source filename [arguments]
-./errors.tests: line 184: .: -i: invalid option
-.: usage: . filename [arguments]
-./errors.tests: line 187: set: -q: invalid option
-set: usage: set [--abefhkmnptuvxBCHP] [-o option] [arg ...]
-./errors.tests: line 190: enable: sh: not a shell builtin
-./errors.tests: line 190: enable: bash: not a shell builtin
-./errors.tests: line 193: shopt: cannot set and unset shell options simultaneously
-./errors.tests: line 196: read: var: invalid timeout specification
-./errors.tests: line 199: read: `/bin/sh': not a valid identifier
-./errors.tests: line 202: VAR: readonly variable
-./errors.tests: line 205: readonly: -x: invalid option
-readonly: usage: readonly [-af] [name[=value] ...] or readonly -p
-./errors.tests: line 208: eval: -i: invalid option
-eval: usage: eval [arg ...]
-./errors.tests: line 209: command: -i: invalid option
-command: usage: command [-pVv] command [arg ...]
-./errors.tests: line 212: /bin/sh + 0: syntax error: operand expected (error token is "/bin/sh + 0")
-./errors.tests: line 213: /bin/sh + 0: syntax error: operand expected (error token is "/bin/sh + 0")
-./errors.tests: line 216: trap: NOSIG: invalid signal specification
-./errors.tests: line 219: trap: -s: invalid option
-trap: usage: trap [-lp] [[arg] signal_spec ...]
-./errors.tests: line 225: return: can only `return' from a function or sourced script
-./errors.tests: line 229: break: 0: loop count out of range
-./errors.tests: line 233: continue: 0: loop count out of range
-./errors.tests: line 238: builtin: bash: not a shell builtin
-./errors.tests: line 242: bg: no job control
-./errors.tests: line 243: fg: no job control
-./errors.tests: line 246: kill: -s: option requires an argument
-./errors.tests: line 248: kill: S: invalid signal specification
-./errors.tests: line 250: kill: `': not a pid or valid job spec
-kill: usage: kill [-s sigspec | -n signum | -sigspec] [pid | job]... or kill -l [sigspec]
-./errors.tests: line 255: set: trackall: invalid option name
-./errors.tests: line 262: `!!': not a valid identifier
diff --git a/tests/exec.right~ b/tests/exec.right~
deleted file mode 100644
index ec3d9e2e..00000000
--- a/tests/exec.right~
+++ /dev/null
@@ -1,53 +0,0 @@
-before exec1.sub: one two three
-calling exec1.sub
-aa bb cc dd ee
-after exec1.sub with args: 0
-
-after exec1.sub without args: 0
-./execscript: line 20: notthere: command not found
-127
-/tmp/bash: notthere: No such file or directory
-127
-/bin/sh: /bin/sh: cannot execute binary file
-126
-./execscript: line 38: /: is a directory
-126
-/: /: cannot execute binary file
-126
-./execscript: line 45: .: /: is a directory
-1
-127
-0
-this is bashenv
-./exec3.sub: line 3: /tmp/bash-notthere: No such file or directory
-./exec3.sub: line 3: exec: /tmp/bash-notthere: cannot execute: No such file or directory
-126
-./execscript: line 67: notthere: No such file or directory
-127
-./execscript: line 70: notthere: No such file or directory
-127
-./execscript: line 73: notthere: No such file or directory
-127
-this is sh
-this is sh
-unset
-ok
-5
-./exec5.sub: line 4: exec: bash-notthere: not found
-127
-this is ohio-state
-0
-1
-1
-0
-42
-42
-0
-1
-1
-0
-0
-1
-0
-1
-testb
diff --git a/tests/execscript~ b/tests/execscript~
deleted file mode 100644
index 03f9570b..00000000
--- a/tests/execscript~
+++ /dev/null
@@ -1,105 +0,0 @@
-export LC_ALL=C
-export LANG=C
-
-if [ $UID -eq 0 ]; then
- echo "execscript: the test suite should not be run as root" >&2
-fi
-
-set -- one two three
-echo before exec1.sub: "$@"
-echo calling exec1.sub
-./exec1.sub aa bb cc dd ee
-echo after exec1.sub with args: $?
-./exec1.sub
-echo after exec1.sub without args: $?
-
-# set up a fixed path so we know notthere will not be found
-PATH=/usr/bin:/bin:/usr/local/bin:
-export PATH
-
-notthere
-echo $?
-
-# this is iffy, since the error messages may vary from system to system
-# and /tmp might not exist
-ln -s ${THIS_SH} /tmp/bash 2>/dev/null
-if [ -f /tmp/bash ]; then
- /tmp/bash notthere
-else
- ${THIS_SH} notthere
-fi
-echo $?
-
-# /bin/sh should be there on all systems
-${THIS_SH} /bin/sh
-echo $?
-
-# try executing a directory
-/
-echo $?
-
-${THIS_SH} /
-echo $?
-
-# try sourcing a directory
-. /
-echo $?
-
-# try sourcing a binary file -- post-2.04 versions don't do the binary file
-# check, and will probably fail with `command not found', or status 127
-. ${THIS_SH} 2>/dev/null
-echo $?
-
-# post-bash-2.05 versions allow sourcing non-regular files
-. /dev/null
-echo $?
-
-# kill two birds with one test -- test out the BASH_ENV code
-echo echo this is bashenv > /tmp/bashenv
-export BASH_ENV=/tmp/bashenv
-${THIS_SH} ./exec3.sub
-rm -f /tmp/bashenv
-unset BASH_ENV
-
-# we're resetting the $PATH to empty, so this should be last
-PATH=
-
-notthere
-echo $?
-
-command notthere
-echo $?
-
-command -p notthere
-echo $?
-
-# but -p should guarantee that we find all the standard utilities, even
-# with an empty or unset $PATH
-command -p sh -c 'echo this is $0'
-unset PATH
-command -p sh -c 'echo this is $0'
-
-# a bug in bash before bash-2.01 caused PATH to be set to the empty string
-# when command -p was run with PATH unset
-echo ${PATH-unset}
-
-echo "echo ok" | ${THIS_SH} -t
-
-${THIS_SH} ./exec2.sub
-echo $?
-
-${THIS_SH} ./exec4.sub
-
-# try exec'ing a command that cannot be found in $PATH
-${THIS_SH} ./exec5.sub
-
-# this was a bug in bash versions before bash-2.04
-${THIS_SH} -c 'cat </dev/null | cat >/dev/null' >&-
-
-# checks for proper return values in subshell commands with inverted return
-# values
-
-${THIS_SH} ./exec6.sub
-
-# checks for properly deciding what constitutes an executable file
-${THIS_SH} ./exec7.sub
diff --git a/tests/histexp.right~ b/tests/histexp.right~
deleted file mode 100644
index ff6453e5..00000000
--- a/tests/histexp.right~
+++ /dev/null
@@ -1,129 +0,0 @@
-echo $BASH_VERSION
-./histexp.tests: line 22: history: !!:z: history expansion failed
- 1 for i in one two three; do echo $i; done
- 2 /bin/sh -c 'echo this is $0'
- 3 ls
- 4 echo $BASH_VERSION
- 1 for i in one two three; do echo $i; done
- 2 /bin/sh -c 'echo this is $0'
- 3 ls
- 4 echo $BASH_VERSION
- 5 HISTFILE=/tmp/newhistory
- 6 echo line 2 for history
-echo line 2 for history
-echo line 2 for history
-set -H
-echo line 2 for history
-line 2 for history
- 1 for i in one two three; do echo $i; done
- 2 /bin/sh -c 'echo this is $0'
- 3 ls
- 4 echo $BASH_VERSION
- 5 HISTFILE=/tmp/newhistory
- 6 echo line 2 for history
- 7 set -H
- 8 echo line 2 for history
-a b c d e
-echo a b c d e
-a b c d e
-echo line 2 for history
-line 2 for history
-echo line 8 for history
-line 8 for history
-/bin/sh -c 'echo this is $0'
-this is /bin/sh
-echo sh
-sh
-echo /bin
-/bin
-echo e
-e
-a b c d e
-echo b c d e
-b c d e
-echo b c d
-b c d
-echo d e
-d e
-echo d e
-d e
-echo b c d
-b c d
-file.c
-echo file
-file
-echo .c
-.c
-echo 'file'
-file
-bax.c
-echo $file
-bax
-echo .c
-.c
-echo '$file'
-$file
-a b c d e
-echo 'a' 'b' 'c' 'd' 'e'
-a b c d e
-echo 'a b c d e'
-a b c d e
-foo.c foo.o foo.html foo.h
-echo bar.c foo.o foo.html foo.h
-bar.c foo.o foo.html foo.h
-echo bar.c bar.o bar.html bar.h
-bar.c bar.o bar.html bar.h
-echo xbar.c xbar.o xbar.html xbar.h
-xbar.c xbar.o xbar.html xbar.h
-echo xbar.c xbar.o xbar.html xbar.h
-xbar.c xbar.o xbar.html xbar.h
-echo xwhix.c xwhix.o xwhix.html xwhix.h
-xwhix.c xwhix.o xwhix.html xwhix.h
-echo xwhix.c xwhix.o xwhix.html xwhix.h
-echo 'xwhix'
-xwhix
-echo 'xwhix.h'
-xwhix.h
-echo 'xwhix.h'
-xwhix.h
-echo 'xwhix.h'
-xwhix.h
- 8 echo line 2 for history
- 9 echo a b c d e
- 10 echo line 2 for history
- 11 echo line 8 for history
- 12 /bin/sh -c 'echo this is $0'
- 13 echo sh
- 14 echo /bin
- 15 echo e
- 16 echo a b c d e
- 17 echo b c d e
- 18 echo b c d
- 19 echo d e
- 20 echo b c d
- 21 echo file.c
- 22 echo file
- 23 echo .c
- 24 echo 'file'
- 25 echo $file.c
- 26 echo $file
- 27 echo .c
- 28 echo '$file'
- 29 echo a b c d e
- 30 echo 'a' 'b' 'c' 'd' 'e'
- 31 echo 'a b c d e'
- 32 echo foo.c foo.o foo.html foo.h
- 33 echo bar.c foo.o foo.html foo.h
- 34 echo bar.c bar.o bar.html bar.h
- 35 echo xbar.c xbar.o xbar.html xbar.h
- 36 echo xwhix.c xwhix.o xwhix.html xwhix.h
- 37 echo xwhix.c xwhix.o xwhix.html xwhix.h
- 38 echo 'xwhix'
- 39 echo 'xwhix.h'
-!!
-!!
-echo '!!' \!\!
-!! !!
-ok 1
-ok 2
-ok 3
diff --git a/tests/history.tests.save b/tests/history.tests.save
deleted file mode 100644
index 4a218c30..00000000
--- a/tests/history.tests.save
+++ /dev/null
@@ -1,97 +0,0 @@
-trap 'rm /tmp/newhistory' 0
-
-# bad options
-history -x
-# cannot use -r and -w at the same time
-history -r -w /dev/null
-
-# bad option
-fc -v
-
-# all of these should result in an empty history list
-history -c
-history -r /dev/null
-history -n /dev/null
-history -c
-
-HISTFILE=history.list
-HISTCONTROL=ignoreboth
-HISTIGNORE='&:history*:fc*'
-HISTSIZE=32
-
-shopt -s cmdhist
-set -o history
-
-history
-
-fc -l
-fc -nl
-
-fc -lr
-fc -nlr
-
-history -s "echo line for history"
-history
-
-history -p '!!'
-
-fc -nl
-
-HISTFILE=/tmp/newhistory
-history -a
-echo displaying \$HISTFILE after history -a
-cat $HISTFILE
-
-history
-history -w
-cat $HISTFILE
-
-history -s "echo line 2 for history"
-history
-history -p '!e'
-history -p '!!'
-
-# this should show up as one history entry
-for x in one two three
-do
- :
-done
-history
-
-# just a basic test. a full test suite for history expansion should be
-# created
-set -H
-!!
-!e
-
-unset HISTSIZE
-unset HISTFILE
-
-fc -l 4
-fc -l 4 8
-
-fc -l 502
-fc -l one=two three=four 502
-
-history 4
-
-shopt -so history
-shopt -s expand_aliases
-
-alias r="fc -s"
-
-echo aa ab ac
-
-r a=x
-r x=4 b=8
-
-# this had better fail with `no command found'
-r cc
-
-unalias -a
-alias
-
-set +o history
-
-shopt -q -o history
-echo $?
diff --git a/tests/jobs.right~ b/tests/jobs.right~
deleted file mode 100644
index 049d3cdd..00000000
--- a/tests/jobs.right~
+++ /dev/null
@@ -1,97 +0,0 @@
-./jobs2.sub: line 9: fg: job 1 started without job control
-fg: 1
-Waiting for job 0
-job 0 returns 0
-Waiting for job 1
-job 1 returns 0
-Waiting for job 2
-job 2 returns 0
-Waiting for job 3
-job 3 returns 0
-Waiting for job 4
-job 4 returns 0
-Waiting for job 5
-job 5 returns 0
-Waiting for job 6
-job 6 returns 0
-Waiting for job 7
-job 7 returns 0
-0
-./jobs.tests: line 15: wait: no job control
-./jobs.tests: line 20: fg: no job control
-wait-for-pid
-wait-errors
-./jobs.tests: line 33: wait: `1-1': not a pid or valid job spec
-./jobs.tests: line 34: wait: `-4': not a pid or valid job spec
-wait-for-background-pids
-async list wait-for-background-pids
-async list wait for child
-forked
-wait-when-no-children
-wait-for-job
-./jobs.tests: line 56: wait: %2: no such job
-127
-async list wait-for-job
-forked
-fg-bg 1
-sleep 5
-fg-bg 2
-sleep 5
-fg-bg 3
-sleep 5
-fg-bg 4
-sleep 5
-fg-bg 5
-./jobs.tests: line 83: fg: %2: no such job
-./jobs.tests: line 84: bg: job 1 already in background
-fg-bg 6
-./jobs.tests: line 91: fg: -s: invalid option
-fg: usage: fg [job_spec]
-./jobs.tests: line 92: bg: -s: invalid option
-bg: usage: bg [job_spec]
-./jobs.tests: line 97: disown: -s: invalid option
-disown: usage: disown [-h] [-ar] [jobspec ...]
-./jobs.tests: line 101: disown: %1: no such job
-./jobs.tests: line 104: disown: %2: no such job
-wait-for-non-child
-./jobs.tests: line 107: wait: pid 1 is not a child of this shell
-127
-3 -- 1 2 3 -- 1 - 2 - 3
-[1] Running sleep 300 &
-[2]- Running sleep 350 &
-[3]+ Running sleep 400 &
-running jobs:
-[1] Running sleep 300 &
-[2]- Running sleep 350 &
-[3]+ Running sleep 400 &
-./jobs.tests: line 123: kill: %4: no such job
-./jobs.tests: line 125: jobs: %4: no such job
-current job:
-[3]+ Running sleep 400 &
-previous job:
-[2]- Running sleep 350 &
-after kill -STOP
-running jobs:
-[1] Running sleep 300 &
-[3]- Running sleep 400 &
-stopped jobs:
-[2]+ Stopped sleep 350
-after disown
-[2]+ Stopped sleep 350
-[3]- Running sleep 400 &
-running jobs:
-[3]- Running sleep 400 &
-stopped jobs:
-[2]+ Stopped sleep 350
-after kill -s CONT
-running jobs:
-[2]+ Running sleep 350 &
-[3]- Running sleep 400 &
-stopped jobs:
-after kill -STOP, backgrounding %3:
-[3]+ sleep 400 &
-killing...
-done
-after KILL -STOP, foregrounding %1
-sleep 10
-done
diff --git a/tests/jobs.tests~ b/tests/jobs.tests~
deleted file mode 100644
index d54c1e94..00000000
--- a/tests/jobs.tests~
+++ /dev/null
@@ -1,179 +0,0 @@
-# test out %+, jobs -p, and $! agreement in a subshell first
-${THIS_SH} ./jobs1.sub
-
-# test out fg/bg failure in a subshell
-${THIS_SH} ./jobs2.sub
-
-# test out behavior of waiting for background pids -- bug in versions
-# before 2.03
-${THIS_SH} ./jobs3.sub
-
-jobs
-echo $?
-
-# should be a job-control-not-enabled error
-wait %1
-
-# make sure we can't fg a job started when job control was not active
-sleep 30 &
-pid=$!
-fg %1
-# make sure the killed processes don't cause a message
-exec 5>&2
-exec 2>/dev/null
-kill -n 9 $pid
-wait # make sure we reap the processes while stderr is still redirected
-exec 2>&5
-
-echo wait-for-pid
-sleep 10 &
-wait $!
-
-echo wait-errors
-wait 1-1
-wait -- -4
-
-echo wait-for-background-pids
-sleep 5 &
-sleep 8 &
-wait
-
-echo async list wait-for-background-pids
-sleep 5 & sleep 8 &
-wait
-
-echo async list wait for child
-sleep 5 & echo forked
-wait
-
-echo wait-when-no-children
-wait
-
-set -m
-
-echo wait-for-job
-sleep 5 &
-wait %2 # this should be a no-such-job error
-echo $?
-wait %1
-
-echo async list wait-for-job
-sleep 5 & echo forked
-wait %1
-
-echo fg-bg 1
-sleep 5 &
-%1
-
-echo fg-bg 2
-sleep 5 &
-fg %%
-
-echo fg-bg 3
-sleep 5 &
-fg %s
-
-echo fg-bg 4
-sleep 5 &
-fg %?ee
-
-# these next two are error cases
-echo fg-bg 5
-sleep 15 &
-fg %2 # this should be a no-such-job error
-bg %1 # this should be a `bg background job?' error
-wait
-
-# these may someday mean to start the jobs, but not print the line
-# describing the status, but for now they are errors
-echo fg-bg 6
-sleep 5 &
-fg -s %1
-bg -s %1
-wait
-
-# someday this may mean to disown all stopped jobs, but for now it is
-# an error
-disown -s
-
-# this is an error -- the job with the pid that is the value of $! is
-# retained only until a `wait' is performed
-disown %1
-
-# this, however, is an error
-disown %2
-
-echo wait-for-non-child
-wait 1
-echo $?
-
-exit 1 | exit 2 | exit 3
-echo $? -- ${PIPESTATUS[@]} -- ${PIPESTATUS[0]} - ${PIPESTATUS[1]} - ${PIPESTATUS[2]}
-
-sleep 300 &
-sleep 350 &
-sleep 400 &
-
-jobs
-
-echo running jobs:
-jobs -r
-
-# should be an error
-kill -n 1 %4
-# should be an error
-jobs %4
-echo current job:
-jobs %+
-echo previous job:
-jobs %-
-
-kill -STOP %2
-sleep 5 # give time for the shell to get the stop notification
-echo after kill -STOP
-echo running jobs:
-jobs -r
-echo stopped jobs:
-jobs -s
-
-disown %1
-
-echo after disown
-jobs
-echo running jobs:
-jobs -r
-echo stopped jobs:
-jobs -s
-
-kill -s CONT %2
-echo after kill -s CONT
-echo running jobs:
-jobs -r
-echo stopped jobs:
-jobs -s
-
-kill -STOP %3
-sleep 5 # give time for the shell to get the stop notification
-echo after kill -STOP, backgrounding %3:
-bg %3
-
-disown -h %2
-
-# make sure the killed processes don't cause a message
-exec 5>&2
-exec 2>/dev/null
-
-echo killing...
-kill -n 9 %2 %3
-wait # make sure we reap the processes while stderr is still redirected
-echo done
-
-exec 2>&5
-
-sleep 10 &
-kill -STOP %1
-sleep 5 # give time for the shell to get the stop notification
-echo after KILL -STOP, foregrounding %1
-fg %1
-
-echo done
diff --git a/tests/misc/regress/log.orig b/tests/misc/regress/log.orig
deleted file mode 100644
index c1f1e199..00000000
--- a/tests/misc/regress/log.orig
+++ /dev/null
@@ -1,50 +0,0 @@
-:; ./shx
-
-sh:
-<&$fd ok
-nlbq Mon Aug 3 02:45:00 EDT 1992
-bang geoff
-quote 712824302
-setbq defmsgid=<1992Aug3.024502.6176@host>
-bgwait sleep done... wait 6187
-
-
-bash:
-<&$fd ok
-nlbq Mon Aug 3 02:45:09 EDT 1992
-bang geoff
-quote 712824311
-setbq defmsgid=<1992Aug3.024512.6212@host>
-bgwait sleep done... wait 6223
-
-
-ash:
-<&$fd shx1: 4: Syntax error: Bad fd number
-nlbq Mon Aug 3 02:45:19 EDT 1992
-bang geoff
-quote getdate: `"now"' not a valid date
-
-setbq defmsgid=<1992Aug3.` echo 024521
-bgwait sleep done... wait 6241
-
-
-ksh:
-<&$fd ok
-nlbq ./shx: 6248 Memory fault - core dumped
-bang geoff
-quote getdate: `"now"' not a valid date
-
-setbq defmsgid=<1992Aug3.024530.6257@host>
-bgwait no such job: 6265
-wait 6265
-sleep done...
-
-zsh:
-<&$fd ok
-nlbq Mon Aug 3 02:45:36 EDT 1992
-bang shx3: event not found: /s/ [4]
-quote 712824337
-setbq defmsgid=<..6290@host>
-bgwait shx7: unmatched " [9]
-sleep done...
-:;
diff --git a/tests/misc/regress/shx.orig b/tests/misc/regress/shx.orig
deleted file mode 100644
index 4b3bf2b8..00000000
--- a/tests/misc/regress/shx.orig
+++ /dev/null
@@ -1,10 +0,0 @@
-#! /bin/sh
-for cmd in sh bash ash ksh zsh
-do
- echo
- echo $cmd:
- for demo in shx?
- do
- $cmd $demo
- done
-done
diff --git a/tests/read.tests~ b/tests/read.tests~
deleted file mode 100644
index e8b7e8f8..00000000
--- a/tests/read.tests~
+++ /dev/null
@@ -1,92 +0,0 @@
-echo " a " | (read x; echo "$x.")
-
-echo " a b " | ( read x y ; echo -"$x"-"$y"- )
-echo " a b\ " | ( read x y ; echo -"$x"-"$y"- )
-echo " a b " | ( read x ; echo -"$x"- )
-echo " a b\ " | ( read x ; echo -"$x"- )
-
-echo " a b\ " | ( read -r x y ; echo -"$x"-"$y"- )
-echo " a b\ " | ( read -r x ; echo -"$x"- )
-
-echo "\ a b\ " | ( read -r x y ; echo -"$x"-"$y"- )
-echo "\ a b\ " | ( read -r x ; echo -"$x"- )
-echo " \ a b\ " | ( read -r x y ; echo -"$x"-"$y"- )
-echo " \ a b\ " | ( read -r x ; echo -"$x"- )
-
-# make sure that CTLESC and CTLNUL are passed through correctly
-echo $'\001' | ( read var ; recho "$var" )
-echo $'\001' | ( read ; recho "$REPLY" )
-
-echo $'\177' | ( read var ; recho "$var" )
-echo $'\177' | ( read ; recho "$REPLY" )
-
-# make sure a backslash-quoted \\n still disappears from the input when
-# we're not reading in `raw' mode, and no stray CTLESC chars are left in
-# the input stream
-echo $'ab\\\ncd' | ( read ; recho "$REPLY" )
-
-echo "A B " > /tmp/IN
-unset x y z
-read x y z < /tmp/IN
-echo 1: "x[$x] y[$y] z[$z]"
-echo 1a: ${z-z not set}
-read x < /tmp/IN
-echo 2: "x[$x]"
-rm /tmp/IN
-
-# this is where the bash `read' behavior with respect to $REPLY differs
-# from ksh93
-echo "A B " > /tmp/IN
-
-read < /tmp/IN
-echo "[$REPLY]"
-
-rm /tmp/IN
-
-echo " A B " > /tmp/IN
-
-read < /tmp/IN
-echo "[$REPLY]"
-
-rm /tmp/IN
-
-# make sure that read with more variables than words sets the extra
-# variables to the empty string
-
-bvar=bvar
-cvar=cvar
-echo aa > /tmp/IN
-read avar bvar cvar < /tmp/IN
-echo =="$avar"==
-echo =="$bvar"==
-echo =="$cvar"==
-
-rm /tmp/IN
-
-# test behavior of read with various settings of IFS
-
-echo " foo" | { IFS= read line; recho "$line"; }
-
-echo " foo" | { IFS= ; read line; recho "$line"; }
-
-echo " foo" | { unset IFS ; read line; recho "$line"; }
-
-echo " foo" | { IFS=$'\n' ; read line; recho "$line"; }
-
-echo " foo" | { IFS=$' \n' ; read line; recho "$line"; }
-
-echo " foo" | { IFS=$' \t\n' ; read line; recho "$line"; }
-
-echo " foo" | { IFS=$':' ; read line; recho "$line"; }
-
-# test read -d delim behavior
-${THIS_SH} ./read1.sub
-
-# test read -t timeout behavior
-${THIS_SH} ./read2.sub
-
-# test read -n nchars behavior
-${THIS_SH} ./read3.sub
-
-# test read -u fd behavior
-${THIS_SH} ./read4.sub
diff --git a/tests/trap.tests~ b/tests/trap.tests~
deleted file mode 100644
index 3e2d00dd..00000000
--- a/tests/trap.tests~
+++ /dev/null
@@ -1,86 +0,0 @@
-# test the trap code
-
-trap 'echo exiting' 0
-trap 'echo aborting' 1 2 3 6 15
-
-# make sure a user-specified subshell runs the exit trap, but does not
-# inherit the exit trap from a parent shell
-( trap 'echo subshell exit' 0; exit 0 )
-( exit 0 )
-
-trap
-
-func()
-{
- trap 'echo ${FUNCNAME:-$0}[$LINENO] funcdebug' DEBUG
- echo funcdebug line
-}
-
-trap 'echo [$LINENO] debug' DEBUG
-echo debug line
-
-trap
-
-func
-
-trap
-
-trap 'echo ${FUNCNAME:-$0}[$LINENO] debug' DEBUG
-func2()
-{
- echo func2debug line
-}
-declare -ft func2
-func2
-
-unset -f func2
-
-trap '' DEBUG
-
-trap
-
-trap - debug
-
-trap
-
-trap - HUP
-trap hup
-trap '' INT
-trap '' int
-
-trap
-
-# exit 0 in exit trap should set exit status
-(
-set -e
-trap 'exit 0' EXIT
-false
-echo bad
-)
-echo $?
-
-# hmmm...should this set the handling to SIG_IGN for children, too?
-trap '' USR2
-./trap1.sub
-
-# test ERR trap
-./trap2.sub
-
-#
-# show that setting a trap on SIGCHLD is not disastrous.
-#
-set -o monitor
-
-trap 'echo caught a child death' SIGCHLD
-
-sleep 7 & sleep 6 & sleep 5 &
-
-wait
-
-trap -p SIGCHLD
-
-# Now reset some of the signals the shell handles specially back to
-# their default values (with or without the SIG prefix)
-trap SIGINT QUIT TERM
-
-trap