Improve failure message
diff --git a/src/assert.bash b/src/assert.bash index a52454a..178e299 100644 --- a/src/assert.bash +++ b/src/assert.bash
@@ -336,8 +336,9 @@ # Matching. if (( is_mode_empty )); then if [ -n "$output" ]; then - echo 'expected no output, but output was non-empty' \ - | batslib_decorate 'unexpected output' \ + batslib_print_kv_single_or_multi 6 \ + 'output' "$output" \ + | batslib_decorate 'output non-empty, but expected no output' \ | fail fi elif (( is_mode_regexp )); then
diff --git a/test/50-assert-16-refute_output.bats b/test/50-assert-16-refute_output.bats index 10c8fc4..35e6fa9 100755 --- a/test/50-assert-16-refute_output.bats +++ b/test/50-assert-16-refute_output.bats
@@ -37,8 +37,8 @@ run refute_output [ "$status" -eq 1 ] [ "${#lines[@]}" -eq 3 ] - [ "${lines[0]}" == '-- unexpected output --' ] - [ "${lines[1]}" == 'expected no output, but output was non-empty' ] + [ "${lines[0]}" == '-- output non-empty, but expected no output --' ] + [ "${lines[1]}" == 'output : a' ] [ "${lines[2]}" == '--' ] }