t3301 (notes): use test_expect_code for clarity

Use the test_expect_code helper instead of open-coding it.

The main behavior change is to print the command and actual exit
status when the test fails.  More importantly, this would make it
easier to add commands before "git notes show" as part of the
same test assertion if needed.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Jonathan Nieder 2010-10-31 02:36:57 -05:00 committed by Junio C Hamano
parent 598f0877aa
commit 0155a64e88

View File

@ -52,7 +52,7 @@ test_expect_success 'refusing to edit notes in refs/remotes/' '
# 1 indicates caught gracefully by die, 128 means git-show barked # 1 indicates caught gracefully by die, 128 means git-show barked
test_expect_success 'handle empty notes gracefully' ' test_expect_success 'handle empty notes gracefully' '
git notes show ; test 1 = $? test_expect_code 1 git notes show
' '
test_expect_success 'show non-existent notes entry with %N' ' test_expect_success 'show non-existent notes entry with %N' '