File tree Expand file tree Collapse file tree 5 files changed +7
-6
lines changed
Expand file tree Collapse file tree 5 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ assert_failure() {
6363 if (( status == 0 )) ; then
6464 { local -ir width=6
6565 batslib_print_kv_single_or_multi " $width " ' output' " $output "
66- if [[ -n " $stderr " ]]; then
66+ if [[ -n " ${ stderr-} " ]]; then
6767 batslib_print_kv_single_or_multi " $width " ' stderr' " $stderr "
6868 fi
6969 } \
@@ -76,7 +76,7 @@ assert_failure() {
7676 ' actual' " $status "
7777 batslib_print_kv_single_or_multi " $width " \
7878 ' output' " $output "
79- if [[ -n " $stderr " ]]; then
79+ if [[ -n " ${ stderr-} " ]]; then
8080 batslib_print_kv_single_or_multi " $width " ' stderr' " $stderr "
8181 fi
8282 } \
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ assert_success() {
3737 { local -ir width=6
3838 batslib_print_kv_single " $width " ' status' " $status "
3939 batslib_print_kv_single_or_multi " $width " ' output' " $output "
40- if [[ -n " $stderr " ]]; then
40+ if [[ -n " ${ stderr-} " ]]; then
4141 batslib_print_kv_single_or_multi " $width " ' stderr' " $stderr "
4242 fi
4343 } \
Original file line number Diff line number Diff line change @@ -22,14 +22,14 @@ ERR_MSG
2222}
2323
2424@test " assert_failure(): returns 1 and displays \`\$ stderr' if it is set" {
25+ bats_require_minimum_version 1.5.0
2526 run --separate-stderr \
2627 bash -c ' echo "a"
2728 echo "b" >&2
2829 exit 0'
30+ echo " Stderr: $stderr " >&3
2931 run assert_failure
3032
31- echo " Stderr: $stderr " >&3
32-
3333 assert_test_fail << 'ERR_MSG '
3434
3535-- command succeeded, but it was expected to fail --
Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ ERR_MSG
4040}
4141
4242@test " assert_success(): displays \`\$ stderr' if it is set" {
43+ bats_require_minimum_version 1.5.0
4344 run --separate-stderr \
4445 bash -c ' echo "a"
4546 echo "b" >&2
Original file line number Diff line number Diff line change @@ -236,7 +236,7 @@ ERR_MSG
236236}
237237
238238@test " refute_stderr(): \` --' stops parsing options" {
239- run echo_err ' --'
239+ run --separate-stderr echo_err ' --'
240240 run refute_stderr -- ' -p'
241241 assert_test_pass
242242}
You can’t perform that action at this time.
0 commit comments