From: Jim Meyering Date: Sat, 24 Oct 2009 11:53:05 +0000 (+0200) Subject: tests: nice: adjust new tests to work more portably X-Git-Tag: v8.1~79 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=50e837b1c454e7eb50d0fc67e7f16668b3e288aa;p=thirdparty%2Fcoreutils.git 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. --- diff --git a/tests/misc/nice b/tests/misc/nice index f271eb446c..cf4d96b230 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