]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: tee: ensure intermittent data is handled
authoroech3 <79379754+oech3@users.noreply.github.com>
Thu, 9 Apr 2026 04:52:50 +0000 (13:52 +0900)
committerPádraig Brady <P@draigBrady.com>
Thu, 9 Apr 2026 11:08:57 +0000 (12:08 +0100)
* tests/tee/tee.sh: Add test case for input from pipe containing sleep.
https://github.com/coreutils/coreutils/pull/247

tests/tee/tee.sh

index 41d1b9acd1c86b41fb63428ac53f4dcfafbc859b..81b6d902beb7b55abb10fed512f4c2d05351d954 100755 (executable)
@@ -21,6 +21,11 @@ print_ver_ tee
 
 echo line >sample || framework_failure_
 
+# Ensure tee detects EOF correctly
+printf "1\n2\n" > exp || framework_failure_
+(echo 1;sleep .1;echo 2) | tee > out || fail=1
+compare exp out || 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)