diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2017-05-24 00:10:18 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2017-05-24 00:10:18 -0400 |
commit | 0ce9e70f12f5bc3521acf0243521a77b80ab02c2 (patch) | |
tree | e23ee4d48c4a3f45e223780a54df64bf09c84e04 | |
parent | 0b4ca504362f65036e27bca620aee9710e2f3004 (diff) |
test: libremessages: check that setup_traps leaves stdout alone
Everything should be on stderr.
-rw-r--r-- | test/lib-messages-test.sh | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/lib-messages-test.sh b/test/lib-messages-test.sh index be6fb0f..3068a98 100644 --- a/test/lib-messages-test.sh +++ b/test/lib-messages-test.sh @@ -53,3 +53,11 @@ it_allows_subheadings_to_flag() { ' -c cdesc' > $tmpdir/exp diff -u $tmpdir/exp $tmpdir/out } + +it_is_quiet_on_stdout_on_errs() { + LC_ALL=C bash -euE -c '. libremessages; setup_traps; false' >"$tmpdir/stdout" 2>"$tmpdir/stderr" || stat=$? + + [[ $stat != 0 ]] + empty "$tmpdir/stdout" + grep '==> ERROR:' "$tmpdir/stderr" +} |