Thread (16 messages) flat view 16 messages, 3 authors, 2016-06-15
STALE3733d

[PATCH 06/10] t3301 (notes): use test_expect_code for clarity

From: Jonathan Nieder <hidden>
Date: 2016-06-15 22:49:57
Subsystem: the rest · Maintainer: Linus Torvalds

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 <redacted>
---
 t/t3301-notes.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/t/t3301-notes.sh b/t/t3301-notes.sh
index 6931171..7e84ab9 100755
--- a/t/t3301-notes.sh
+++ b/t/t3301-notes.sh
@@ -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' '
-- 
1.7.2.3.557.gab647.dirty
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help