Include -C in the test, since splice can have an effect (#166).

This commit is contained in:
Andrew Wood
2025-10-05 21:50:09 +01:00
parent 3437b75256
commit 80b68a73ee
@@ -51,4 +51,25 @@ if ! test "${catOutput}" = 'fghi'; then
exit 1
fi
# Test again with -C to ensure that it works with splice turned off.
printf '%s\n' 'abcdefghi' | (
"${testSubject}" -qCSs5 > "${workFile1}"
cat > "${workFile2}"
)
# pv should have read 5 bytes and put them into workFile1.
pvOutput="$(cat "${workFile1}")"
if ! test "${pvOutput}" = 'abcde'; then
echo "with -C, expected pv to write [abcde], got [${pvOutput}]"
exit 1
fi
# cat should have read the remaining bytes and put them into workFile2.
catOutput="$(cat "${workFile2}")"
if ! test "${catOutput}" = 'fghi'; then
echo "with pv -C, expected cat to write [fghi], got [${catOutput}]"
exit 1
fi
exit 0