* tests/shuf/shuf.sh: Ensure we exit 1 upon failure
to allocate memory.
https://github.com/uutils/coreutils/issues/11170
https://github.com/coreutils/coreutils/pull/209
printf '1\0' > exp || framework_failure_
cmp out exp || { fail=1; echo "missing NUL terminator?" 1>&2; }
+# Ensure shuf exits with 1 if memory exhausted
+vm=$(get_min_ulimit_v_ shuf -i1-1) && (ulimit -v $vm shuf -i1-1) && {
+ (ulimit -v $vm && returns_ 1 shuf -i1-$SIZE_MAX) || fail=1
+}
+
# Ensure shuf -n operates efficiently for small n. Before coreutils-8.13
# this would try to allocate $SIZE_MAX * sizeof(size_t)
timeout 10 shuf -i1-$SIZE_MAX -n2 >/dev/null ||