From: Karl Hasselström Date: Sun, 6 Jul 2008 16:09:08 +0000 (+0200) Subject: Test for specific exit code X-Git-Tag: v0.15-rc1~201 X-Git-Url: https://git.distorted.org.uk/~mdw/stgit/commitdiff_plain/f03004e2c26efcd6b172a915e8e0d2f9a7cb064b?ds=inline;hp=f749e393e47687971777d79c043562a91e4f493d Test for specific exit code When a command is supposed to fail in a test, test for the exact error code we're expecting, not just that it's non-zero. This makes sure e.g. that a command that's supposed to fail doesn't do so with an unhandled exception. Signed-off-by: Karl Hasselström --- diff --git a/t/README b/t/README index 77f0b6c..757f810 100644 --- a/t/README +++ b/t/README @@ -163,9 +163,9 @@ library for your script to use. yields success, test is considered a failure. This should _not_ be used for tests that succeed when their - commands fail -- use test_expect_success and shell negation (!) for - that. test_expect_failure is for cases when a test is known to be - broken. + commands fail -- use test_expect_success and one of general_error, + command_error, and conflict for that. test_expect_failure is for + cases when a test is known to be broken. - test_debug