]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
shuf: test input-closed bug
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 26 Nov 2016 23:37:43 +0000 (15:37 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 26 Nov 2016 23:38:08 +0000 (15:38 -0800)
Problem reported by Alex Ryan (Bug#25029).
* tests/misc/shuf.sh: Test for shuffling with stdin closed.

tests/misc/shuf.sh

index dcc7e82a3ea17c007eb4c13ed6bca33500c94c91..2e6141b7035ff1a260a8ffeec04d7f6b0ff2ac5a 100755 (executable)
@@ -166,4 +166,9 @@ printf "A\nB\nC\nD\nE\n" | shuf --rep -n0 > exp || framework_failure_
 test \! -s exp ||
   { fail=1; echo "--repeat,STDIN,-n0 produced bad output">&2 ; }
 
+# shuf 8.25 mishandles input if stdin is closed, due to glibc bug#15589.
+# See coreutils bug#25029.
+shuf /dev/null <&- >out || fail=1
+compare /dev/null out || fail=1
+
 Exit $fail