Files
fish-shell/tests/checks/output-buffering.fish
Noah Hellman a0d8d27f45 tests: use command instead of absolute paths
These binaries are not guaranteed to exist at /bin/X on all systems,
e.g. nixos does not place binaries there, but as long as they are in the
PATH we can find them with command.

Part of #12544
2026-03-15 17:46:24 +08:00

45 lines
699 B
Fish

# RUN: fish=%fish %fish %s
set -g nproc (
if command -v nproc >/dev/null
nproc
else
sysctl -n hw.logicalcpu
end
)
function run-concurrently
for i in (seq (math "10 * min($nproc, 16)"))
$fish -c $argv[1] &
end
wait
end
run-concurrently '
set t "$(
command echo -n A
echo -n B
)"
test $t = AB
or echo $t
'
run-concurrently '
eval "
command echo -n C
echo -n D
" | read -l t
test $t = CD
or echo $t
'
run-concurrently '
# block/function node output is buffered also
begin
command echo -n E
echo -n F
end |
read -l t
test $t = EF
or echo $t
'