diff options
author | Jim Meyering <meyering@redhat.com> | 2009-10-24 13:53:05 +0200 |
---|---|---|
committer | Jim Meyering <meyering@redhat.com> | 2009-10-26 08:25:34 +0100 |
commit | 50e837b1c454e7eb50d0fc67e7f16668b3e288aa (patch) | |
tree | 7b07c2e0f1a4f0b2e37b264d3c1fe819d7ad9ece /tests | |
parent | 501bf7b589e8c63c408c86fce5bb9902ae019017 (diff) | |
download | coreutils-50e837b1c454e7eb50d0fc67e7f16668b3e288aa.tar.xz |
tests: nice: adjust new tests to work more portably
* tests/misc/nice (tests): Accommodate a nice program for which
"nice -n -1 nice" prints nothing. It should print -1 or (usually) 0.
Otherwise, we'd get syntax errors.
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/misc/nice | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/misc/nice b/tests/misc/nice index f271eb446..cf4d96b23 100755 --- a/tests/misc/nice +++ b/tests/misc/nice @@ -75,7 +75,7 @@ while :; do done # Test negative niceness - command must be run whether or not change happens. -if test `nice -n -1 nice 2> /dev/null` = 0 ; then +if test x`nice -n -1 nice 2> /dev/null` = x0 ; then # unprivileged user - warn about failure to change nice -n -1 true 2> err || fail=1 test -s err || fail=1 @@ -86,8 +86,8 @@ else # superuser - change succeeds nice -n -1 nice 2> err || fail=1 test -s err && fail=1 - test `nice -n -1 nice` = -1 || fail=1 - test `nice --1 nice` = -1 || fail=1 + test x`nice -n -1 nice` = x-1 || fail=1 + test x`nice --1 nice` = x-1 || fail=1 fi Exit $fail |