]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t3301 (notes): use test_expect_code for clarity
authorJonathan Nieder <jrnieder@gmail.com>
Sun, 31 Oct 2010 07:36:57 +0000 (02:36 -0500)
committerJunio C Hamano <gitster@pobox.com>
Tue, 9 Nov 2010 23:00:43 +0000 (15:00 -0800)
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>
t/t3301-notes.sh

index 69311713d71f669be643cd0dcdfc9bd5b9682d40..7e84ab97903a890a7d9fabc304cad7531e9b915b 100755 (executable)
@@ -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
 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' '