bats_pipe command0 | command1

Paired with run, the bats_pipe help function allows testing command pipelines. For this function, the pipeline separator is \\| and not |.

Usage

-<N>Return the exit code from the th command in the chain of piped commands, instead of default behavior of “the last non-zero status”.

Examples

Executing a command with run and bats_pipe
1
2
3
@test "executing pipeline with commands a and b with run and bats_pipe" {
    run bats_pipe a \| b
}
BashSupport Pro 是一款shell 脚本集成开发环境,支持 bats-core 的 bats_pipe - 立即试用
© 2020–2024 Joachim Ansorg
声明
隐私政策
许可条款