From 50e837b1c454e7eb50d0fc67e7f16668b3e288aa Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sat, 24 Oct 2009 13:53:05 +0200 Subject: 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. --- tests/misc/nice | 6 +++--- 1 file 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 -- cgit v1.2.3-54-g00ecf