From e8ebacab6957d0b3227158539203fb70c284bbac Mon Sep 17 00:00:00 2001 From: Tony Duckles Date: Thu, 9 Aug 2012 22:26:07 -0500 Subject: [PATCH] test-lib: test_expect_failure() expected failure is ok The Git test-lib test_expect_failure() behavior is to call separate test_known_ok/test_known_broken_failure helper tags which puts the "known failure" results into separate buckets. This is the opposite of what I want. I want test_expect_failure() to be the true-opposite of test_expect_success(): if we expect a test to fail (i.e. exit 1), then say the test passed if the command failed. * tests/test-lib-functions.sh (test_expect_failure): Change test_expect_failure() to be the true-opposite of test_expect_success(): test succeeds if command exits with error code. --- tests/test-lib-functions.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test-lib-functions.sh b/tests/test-lib-functions.sh index 0743251..2bad584 100755 --- a/tests/test-lib-functions.sh +++ b/tests/test-lib-functions.sh @@ -10,9 +10,9 @@ test_expect_failure () { say >&3 "checking known breakage: $2" if test_run_ "$2" expecting_failure then - test_known_broken_ok_ "$1" + test_failure_ "$1" else - test_known_broken_failure_ "$1" + test_ok_ "$1" fi fi echo >&3 "" -- 2.43.0