From: Junio C Hamano Date: Sat, 5 Jan 2008 06:45:08 +0000 (-0800) Subject: t/t3800: do not use a temporary file to hold expected result. X-Git-Tag: v1.5.4-rc3~45 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=e9b20943b7713ed7c051621f97e12713ccf98e1f;p=git.git 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 --- diff --git a/t/t3800-mktag.sh b/t/t3800-mktag.sh index e5f3073f8..f2803206f 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 <