Skip to content

Commit

Permalink
* Adding comment about pipe_count.
Browse files Browse the repository at this point in the history
  • Loading branch information
qec-pconner authored and martin-schulze-vireso committed Jul 13, 2023
1 parent b479c17 commit 2547ad4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/bats-core/test_functions.bash
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,8 @@ bats_pipe() { # [-N] [--] command0 [ \| command1 [ \| command2 [...]]]
return 1
fi

# there will be pipe_count + 1 entries in PIPE_STATUS (pipe_count number of \|'s between each entry).
# valid indices are [0; pipe_count]
if [ -n "$pipestatus_position" ] && (( pipestatus_position > pipe_count )); then
printf "Usage error: Too large of -N argument given. Argument value: '%s'.\n" "$pipestatus_position" >&2
return 1
Expand Down

0 comments on commit 2547ad4

Please sign in to comment.