From: Pádraig Brady Date: Mon, 4 May 2026 22:18:52 +0000 (+0100) Subject: tests: fix false failure with spaces in hierarchy X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=dce828c3d653761daa5f5508369f9ed41436b453;p=thirdparty%2Fcoreutils.git tests: fix false failure with spaces in hierarchy * tests/sort/sort-buffer-size.sh: Use `pwd` rather than $PWD, and quote appropriately. Reported by Bruno Haible. --- diff --git a/tests/sort/sort-buffer-size.sh b/tests/sort/sort-buffer-size.sh index b25e270aac..ed4b6c0d32 100755 --- a/tests/sort/sort-buffer-size.sh +++ b/tests/sort/sort-buffer-size.sh @@ -31,20 +31,22 @@ test "$rlimit" = 'unlimited' || test "$(($rlimit/1024))" -gt 120 || skip_ 'unable to determine enough resources available' +cwd=$(pwd) + # Without an explicit -S, sort should grow a pipe buffer enough to avoid # creating a temporary file for this input. -tac exp | TMPDIR=$PWD/no-temp sort --parallel=1 > out || fail=1 +tac exp | TMPDIR="$cwd"/no-temp sort --parallel=1 > out || fail=1 { test -s out && compare exp out; } || fail=1 # Check the same path when sort has precomputed key pointers in the # line table that must be adjusted after the buffer moves. sed 's/^/k /' exp > exp-key || framework_failure_ -tac exp-key | TMPDIR=$PWD/no-temp sort --parallel=1 -k2,2 > out || fail=1 +tac exp-key | TMPDIR="$cwd"/no-temp sort --parallel=1 -k2,2 > out || fail=1 { test -s out && compare exp-key out; } || fail=1 # An explicit -S remains a limit for ordinary buffer growth, so this must # still need a temporary file and fail because TMPDIR is not a directory. -returns_ 2 env TMPDIR=$PWD/no-temp \ +returns_ 2 env TMPDIR="$cwd"/no-temp \ $SHELL -c 'tac exp | sort --parallel=1 -S 1M > small-out' || fail=1 Exit $fail