summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChet Ramey <chet.ramey@case.edu>2011-12-12 22:09:35 -0500
committerChet Ramey <chet.ramey@case.edu>2011-12-12 22:09:35 -0500
commit06dff54a99dc0627c519143a28161b7324749a6b (patch)
tree3e299558a336a4fca4631e9602fd46fb2ad17865 /tests
parente05be32def741aff2237e1bb5ba5494ceca12654 (diff)
downloadbash-06dff54a99dc0627c519143a28161b7324749a6b.tar.gz
commit bash-4.2-alpha snapshot
Diffstat (limited to 'tests')
-rw-r--r--tests/arith.right4
-rw-r--r--tests/arith3.sub4
-rw-r--r--tests/lastpipe.tests7
-rw-r--r--tests/posixexp2.sub2
-rw-r--r--tests/type3.sub1
5 files changed, 12 insertions, 6 deletions
diff --git a/tests/arith.right b/tests/arith.right
index 8f5d2ab3..ff98432b 100644
--- a/tests/arith.right
+++ b/tests/arith.right
@@ -198,8 +198,8 @@ ok
-3
2
4
-10000
-10000
+5000
+5000
2147483649
8 12
./arith.tests: line 278: ((: x=9 y=41 : syntax error in expression (error token is "y=41 ")
diff --git a/tests/arith3.sub b/tests/arith3.sub
index e8464474..a510c739 100644
--- a/tests/arith3.sub
+++ b/tests/arith3.sub
@@ -28,14 +28,14 @@ echo ${dice[11]}
unset dice1 dice2
RANDOM=42
-for i in {1..10000}; do ((dice1[$RANDOM%6+1 + $RANDOM%6+1]++)); done;
+for i in {1..5000}; do ((dice1[$RANDOM%6+1 + $RANDOM%6+1]++)); done;
unset t; for i in ${dice1[@]}; do ((t+=i)); done; echo $t
foo="${dice1[@]}"
RANDOM=42
-for i in {1..10000}; do ((dice2[RANDOM%6+1 + RANDOM%6+1]++)); done;
+for i in {1..5000}; do ((dice2[RANDOM%6+1 + RANDOM%6+1]++)); done;
unset t; for i in ${dice2[@]}; do ((t+=i)); done; echo $t
bar="${dice2[@]}"
diff --git a/tests/lastpipe.tests b/tests/lastpipe.tests
index c846316e..13fa214f 100644
--- a/tests/lastpipe.tests
+++ b/tests/lastpipe.tests
@@ -1,3 +1,8 @@
+binfalse()
+{
+ $binfalse || return 1 # normalize return value
+}
+
if [ -x /usr/bin/true ]; then
bintrue=/usr/bin/true
elif [ -x /bin/true ]; then
@@ -45,7 +50,7 @@ set -o pipefail
true | $bintrue | false
echo $? -- ${PIPESTATUS[@]}
-true | $binfalse | true
+true | binfalse | true
echo $? -- ${PIPESTATUS[@]}
set +o pipefail
diff --git a/tests/posixexp2.sub b/tests/posixexp2.sub
index 9780f71a..f48d0887 100644
--- a/tests/posixexp2.sub
+++ b/tests/posixexp2.sub
@@ -4,7 +4,7 @@ x=a\ b
set -- ${x?}
{ [ "$#" = 2 ] && [ "$1" = a ] && [ "$2" = b ]; } || exit 1
unset x
-(echo ${x?abcdefg}) 2>&1 | grep -q abcdefg || exit 1
+(echo ${x?abcdefg}) 2>&1 | grep abcdefg >/dev/null || exit 1
${THIS_SH} -c 'unset foo; echo ${foo?}' 2>/dev/null && exit 2
${THIS_SH} -c 'foo=; echo ${foo:?}' 2>/dev/null && exit 3
${THIS_SH} -c 'foo=; echo ${foo?}' >/dev/null || exit 4
diff --git a/tests/type3.sub b/tests/type3.sub
index 5eb3febe..ecbd392a 100644
--- a/tests/type3.sub
+++ b/tests/type3.sub
@@ -10,6 +10,7 @@ foo() {
type foo
+cd ${TMPDIR:-/var/tmp}
eval "$(type foo | sed 1d)"
foo