From e9b20943b7713ed7c051621f97e12713ccf98e1f Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Fri, 4 Jan 2008 22:45:08 -0800 Subject: [PATCH] t/t3800: do not use a temporary file to hold expected result. It is a good practice to write program output to a temporary file during the test, as it would allow easier postmortem when the tested program does break. But there is no benefit in writing the expected output out to the temporary. This actually fixes a bug in check_verify_failure() routine. The intention of the test seems to make sure the "git mktag" command fails, and it spits out the expected error message. But if the command did not fail as expected, the shell function as originally written would not have detected the failure. Signed-off-by: Junio C Hamano --- t/t3800-mktag.sh | 89 ++++++++++++++++---------------------------------------- 1 file changed, 25 insertions(+), 64 deletions(-) diff --git a/t/t3800-mktag.sh b/t/t3800-mktag.sh index e5f3073f88..f2803206f1 100755 --- a/t/t3800-mktag.sh +++ b/t/t3800-mktag.sh @@ -12,10 +12,11 @@ test_description='git-mktag: tag object verify test' # given in the expect.pat file. check_verify_failure () { - test_expect_success \ - "$1" \ - 'git-mktag message || - grep -q -f expect.pat message' + expect="$2" + test_expect_success "$1" ' + ( ! git-mktag message ) && + grep -q "$expect" message + ' } ########################################################### @@ -33,11 +34,8 @@ cat >tag.sig <expect.pat <expect.pat <expect.pat <expect.pat <tag.sig printf "type tagsssssssssssssssssssssssssssssss" >>tag.sig -cat >expect.pat <expect.pat <expect.pat <expect.pat <expect.pat <expect.pat <expect.pat <expect.pat <