Enforcing this interface behavior is worthwhile
irrespective of our current implementation,
to ensure future or other implementations conform.
* tests/fold/fold-characters.sh: Ensure the fold implementation
uses bounded memory.
fold --characters -w 10 input2 > character-out2 || fail=1
compare character-exp2 character-out2 || fail=1
+# Ensure bounded memory operation
+vm=$(get_min_ulimit_v_ fold /dev/null) && {
+ yes | tr -d '\n' | (ulimit -v $(($vm+8000)) && fold 2>err) | head -n10 || fail=1
+ compare /dev/null err || fail=1
+}
+
Exit $fail