summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2012-01-26 11:40:09 -0800
committerJunio C Hamano <gitster@pobox.com>2012-01-26 11:40:09 -0800
commite7d7a56796c457b0a96e58e7638950db824b52af (patch)
tree891c2c9d425ab9e6c2833ba8afdeb9d876c8c3d8
parent3558f32f1f5fdb3d566e39f6e07cd3f97d124da6 (diff)
downloadgit-e7d7a56796c457b0a96e58e7638950db824b52af.tar.gz
t9801: do not overuse test_must_failva/git-p4-branch
test_must_fail is to make sure a program we can potentially break during the course of updating git itself exits with a non-zero status in a clean and controlled way. When we expect a non-zero exit status from the commands we use from the underlying platform in tests, e.g. making sure a string "error: " does not appear in the output by running "grep 'error: '", just use "! grep" for readability. It is not like we will try to update Git and suddenly 'grep' we use from the system starts segfaulting. Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rwxr-xr-xt/t9801-git-p4-branch.sh8
1 files changed, 4 insertions, 4 deletions
diff --git a/t/t9801-git-p4-branch.sh b/t/t9801-git-p4-branch.sh
index 6ff713b1f7..d414705416 100755
--- a/t/t9801-git-p4-branch.sh
+++ b/t/t9801-git-p4-branch.sh
@@ -208,7 +208,7 @@ test_expect_success 'git-p4 clone simple branches' '
test -f file1 &&
test -f file2 &&
test ! -f file3 &&
- test_must_fail grep update file2 &&
+ ! grep update file2 &&
git reset --hard p4/depot/branch3 &&
test -f file1 &&
test -f file2 &&
@@ -286,7 +286,7 @@ test_expect_success 'git-p4 clone complex branches' '
test_path_is_file file1 &&
test_path_is_file file2 &&
test_path_is_missing file3 &&
- test_must_fail grep update file2 &&
+ ! grep update file2 &&
git reset --hard p4/depot/branch3 &&
test_path_is_file file1 &&
test_path_is_file file2 &&
@@ -296,12 +296,12 @@ test_expect_success 'git-p4 clone complex branches' '
test_path_is_file file1 &&
test_path_is_file file2 &&
test_path_is_missing file3 &&
- test_must_fail grep update file2 &&
+ ! grep update file2 &&
git reset --hard p4/depot/branch5 &&
test_path_is_file file1 &&
test_path_is_file file2 &&
test_path_is_file file3 &&
- test_must_fail grep update file2 &&
+ ! grep update file2 &&
test_path_is_missing .git/git-p4-tmp
)
'