1
0
mirror of https://github.com/sstephenson/bats.git synced 2024-12-27 06:59:45 +01:00

test(run): Add test for separate output and error

This commit is contained in:
Frédéric Combes 2017-09-12 14:24:38 +02:00
parent 03608115df
commit efd492cb1e
2 changed files with 19 additions and 0 deletions

View File

@ -262,3 +262,8 @@ fixtures bats
[ $status -eq 0 ]
[ "${lines[1]}" = "ok 1 loop_func" ]
}
@test "testing stdout and stderr are separated" {
run bats "$FIXTURE_ROOT/stdout_stderr_separate.bats"
[ $status -eq 0 ]
}

View File

@ -0,0 +1,14 @@
# see issue #89
echo_std_err() {
echo "std output"
(>&2 echo "err output")
return 0
}
@test "std err" {
run echo_std_err
[ $status -eq 0 ]
[ "${stdout}" = "std output" ]
[ "${stderr}" = "err output" ]
[ "${output}" = "std outputerr output" ]
}