]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: tee: ensure tee is non buffered
authorPádraig Brady <P@draigBrady.com>
Sun, 3 May 2026 10:28:19 +0000 (11:28 +0100)
committerPádraig Brady <P@draigBrady.com>
Sun, 3 May 2026 10:31:27 +0000 (11:31 +0100)
* tests/tee/tee.sh: tests/misc/responsive.sh only confirms
responsiveness to lines, so add a test for non line terminated.
https://github.com/coreutils/coreutils/pull/259

tests/tee/tee.sh

index eccfdb87555197ff7635d674c90b651b0de95821..5c4de6a5e31a1571eb1ce4b5c4fa3a1fb2c4c7ec 100755 (executable)
@@ -26,6 +26,12 @@ printf "1\n2\n" > exp || framework_failure_
 (echo 1;sleep .1;echo 2) | tee > out || fail=1
 compare exp out || fail=1
 
+# Ensure tee is not buffered
+tee_output() { sleep $1; test -s tee_output; }
+{ printf 'a'; retry_delay_ tee_output .1 7 || touch no_output; } |
+ tee > tee_output
+test -e no_output && fail=1;
+
 # POSIX says: "Processing of at least 13 file operands shall be supported."
 for n in 0 1 2 12 13; do
   files=$(seq $n)