- Add tests for hash and return and more tests for set -e.

- Simplify regress.sh, sort tests.
This commit is contained in:
Stefan Farfeleder 2005-09-05 09:42:10 +00:00
parent 9b4261c9b4
commit e594c724ee
15 changed files with 78 additions and 9 deletions

View file

@ -0,0 +1,5 @@
# $FreeBSD$
cat /dev/null
hash
hash -r
hash

View file

@ -0,0 +1 @@
/bin/cat

View file

@ -0,0 +1,4 @@
# $FreeBSD$
hash
hash cat
hash

View file

@ -0,0 +1 @@
/bin/cat

View file

@ -0,0 +1,3 @@
# $FreeBSD$
hash -v cat
hash

View file

@ -0,0 +1,2 @@
/bin/cat
/bin/cat

View file

@ -0,0 +1,7 @@
# $FreeBSD$
f() {
return 0
exit 1
}
f

View file

@ -0,0 +1,7 @@
# $FreeBSD$
f() {
true && return 1
return 0
}
f

View file

@ -0,0 +1,3 @@
# $FreeBSD$
return 1
exit 0

View file

@ -1,6 +1,6 @@
# $FreeBSD$
echo '1..31'
echo '1..42'
COUNTER=1
@ -31,12 +31,7 @@ do_test() {
rm tmp.stdout tmp.stderr
}
SUCCESS=$(find . -name "*.0")
for i in ${SUCCESS} ; do
do_test ${i} 0
done
FAILURE=$(find . -name "*.1")
for i in ${FAILURE} ; do
do_test ${i} 1
TESTS=$(find -s . -name "*.[01]")
for i in ${TESTS} ; do
do_test ${i} ${i##*.}
done

View file

@ -0,0 +1,9 @@
# $FreeBSD$
set -e
f() {
for i in a b c; do
false
true
done
}
f || true

View file

@ -0,0 +1,7 @@
# $FreeBSD$
set -e
f() {
false
true
}
f || true

View file

@ -0,0 +1,7 @@
# $FreeBSD$
set -e
f() {
false
exit 0
}
f

View file

@ -0,0 +1,9 @@
# $FreeBSD$
set -e
f() {
until false; do
false
break
done
}
f || true

View file

@ -0,0 +1,9 @@
# $FreeBSD$
set -e
f() {
while true; do
false
break
done
}
f || true