提交 4265ee3e 编写于 作者: J Junio C Hamano

Merge branch 'jh/use-test-must-fail'

* jh/use-test-must-fail:
  Convert "! git" to "test_must_fail git"
...@@ -359,7 +359,7 @@ test_expect_success \ ...@@ -359,7 +359,7 @@ test_expect_success \
test_expect_success \ test_expect_success \
'a/b (untracked) vs a, plus c/d case test.' \ 'a/b (untracked) vs a, plus c/d case test.' \
'! git read-tree -u -m "$treeH" "$treeM" && 'test_must_fail git read-tree -u -m "$treeH" "$treeM" &&
git ls-files --stage && git ls-files --stage &&
test -f a/b' test -f a/b'
......
...@@ -299,7 +299,7 @@ cat expect-F >> expect-rm-F ...@@ -299,7 +299,7 @@ cat expect-F >> expect-rm-F
test_expect_success 'verify note removal with -F /dev/null' ' test_expect_success 'verify note removal with -F /dev/null' '
git log -4 > output && git log -4 > output &&
test_cmp expect-rm-F output && test_cmp expect-rm-F output &&
! git notes show test_must_fail git notes show
' '
test_expect_success 'do not create empty note with -m "" (setup)' ' test_expect_success 'do not create empty note with -m "" (setup)' '
...@@ -309,7 +309,7 @@ test_expect_success 'do not create empty note with -m "" (setup)' ' ...@@ -309,7 +309,7 @@ test_expect_success 'do not create empty note with -m "" (setup)' '
test_expect_success 'verify non-creation of note with -m ""' ' test_expect_success 'verify non-creation of note with -m ""' '
git log -4 > output && git log -4 > output &&
test_cmp expect-rm-F output && test_cmp expect-rm-F output &&
! git notes show test_must_fail git notes show
' '
cat > expect-combine_m_and_F << EOF cat > expect-combine_m_and_F << EOF
...@@ -357,7 +357,7 @@ cat expect-multiline >> expect-rm-remove ...@@ -357,7 +357,7 @@ cat expect-multiline >> expect-rm-remove
test_expect_success 'verify note removal with "git notes remove"' ' test_expect_success 'verify note removal with "git notes remove"' '
git log -4 > output && git log -4 > output &&
test_cmp expect-rm-remove output && test_cmp expect-rm-remove output &&
! git notes show HEAD^ test_must_fail git notes show HEAD^
' '
cat > expect << EOF cat > expect << EOF
......
...@@ -67,7 +67,7 @@ test_expect_success 'remove some commits' ' ...@@ -67,7 +67,7 @@ test_expect_success 'remove some commits' '
test_expect_success 'verify that commits are gone' ' test_expect_success 'verify that commits are gone' '
! git cat-file -p 5ee1c35e83ea47cd3cc4f8cbee0568915fbbbd29 && test_must_fail git cat-file -p 5ee1c35e83ea47cd3cc4f8cbee0568915fbbbd29 &&
git cat-file -p 08341ad9e94faa089d60fd3f523affb25c6da189 && git cat-file -p 08341ad9e94faa089d60fd3f523affb25c6da189 &&
git cat-file -p ab5f302035f2e7aaf04265f08b42034c23256e1f git cat-file -p ab5f302035f2e7aaf04265f08b42034c23256e1f
' '
...@@ -106,7 +106,7 @@ test_expect_success 'prune notes' ' ...@@ -106,7 +106,7 @@ test_expect_success 'prune notes' '
test_expect_success 'verify that notes are gone' ' test_expect_success 'verify that notes are gone' '
! git notes show 5ee1c35e83ea47cd3cc4f8cbee0568915fbbbd29 && test_must_fail git notes show 5ee1c35e83ea47cd3cc4f8cbee0568915fbbbd29 &&
git notes show 08341ad9e94faa089d60fd3f523affb25c6da189 && git notes show 08341ad9e94faa089d60fd3f523affb25c6da189 &&
git notes show ab5f302035f2e7aaf04265f08b42034c23256e1f git notes show ab5f302035f2e7aaf04265f08b42034c23256e1f
' '
...@@ -130,8 +130,8 @@ test_expect_success 'prune -v notes' ' ...@@ -130,8 +130,8 @@ test_expect_success 'prune -v notes' '
test_expect_success 'verify that notes are gone' ' test_expect_success 'verify that notes are gone' '
! git notes show 5ee1c35e83ea47cd3cc4f8cbee0568915fbbbd29 && test_must_fail git notes show 5ee1c35e83ea47cd3cc4f8cbee0568915fbbbd29 &&
! git notes show 08341ad9e94faa089d60fd3f523affb25c6da189 && test_must_fail git notes show 08341ad9e94faa089d60fd3f523affb25c6da189 &&
git notes show ab5f302035f2e7aaf04265f08b42034c23256e1f git notes show ab5f302035f2e7aaf04265f08b42034c23256e1f
' '
......
...@@ -43,11 +43,11 @@ test_expect_success 'setup' ' ...@@ -43,11 +43,11 @@ test_expect_success 'setup' '
# G2 = same changes as G # G2 = same changes as G
test_expect_success 'skip same-resolution merges with -p' ' test_expect_success 'skip same-resolution merges with -p' '
git checkout H && git checkout H &&
! git merge E && test_must_fail git merge E &&
test_commit L file1 23 && test_commit L file1 23 &&
git checkout I && git checkout I &&
test_commit G2 file1 3 && test_commit G2 file1 3 &&
! git merge E && test_must_fail git merge E &&
test_commit J file1 23 && test_commit J file1 23 &&
test_commit K file7 file7 && test_commit K file7 file7 &&
git rebase -i -p L && git rebase -i -p L &&
...@@ -65,11 +65,11 @@ test_expect_success 'skip same-resolution merges with -p' ' ...@@ -65,11 +65,11 @@ test_expect_success 'skip same-resolution merges with -p' '
# G2 = different changes as G # G2 = different changes as G
test_expect_success 'keep different-resolution merges with -p' ' test_expect_success 'keep different-resolution merges with -p' '
git checkout H && git checkout H &&
! git merge E && test_must_fail git merge E &&
test_commit L2 file1 23 && test_commit L2 file1 23 &&
git checkout I && git checkout I &&
test_commit G3 file1 4 && test_commit G3 file1 4 &&
! git merge E && test_must_fail git merge E &&
test_commit J2 file1 24 && test_commit J2 file1 24 &&
test_commit K2 file7 file7 && test_commit K2 file7 file7 &&
test_must_fail git rebase -i -p L2 && test_must_fail git rebase -i -p L2 &&
......
...@@ -58,7 +58,7 @@ test_expect_success 'pull with -X' ' ...@@ -58,7 +58,7 @@ test_expect_success 'pull with -X' '
git reset --hard master && git pull -s recursive -X ours . side && git reset --hard master && git pull -s recursive -X ours . side &&
git reset --hard master && git pull -s recursive -Xtheirs . side && git reset --hard master && git pull -s recursive -Xtheirs . side &&
git reset --hard master && git pull -s recursive -X theirs . side && git reset --hard master && git pull -s recursive -X theirs . side &&
git reset --hard master && ! git pull -s recursive -X bork . side git reset --hard master && test_must_fail git pull -s recursive -X bork . side
' '
test_done test_done
...@@ -111,7 +111,7 @@ test_expect_success '--amend option with empty author' ' ...@@ -111,7 +111,7 @@ test_expect_success '--amend option with empty author' '
test_when_finished "git checkout Initial" && test_when_finished "git checkout Initial" &&
echo "Empty author test" >>foo && echo "Empty author test" >>foo &&
test_tick && test_tick &&
! git commit -a -m "empty author" --amend 2>err && test_must_fail git commit -a -m "empty author" --amend 2>err &&
grep "empty ident" err grep "empty ident" err
' '
...@@ -125,7 +125,7 @@ test_expect_success '--amend option with missing author' ' ...@@ -125,7 +125,7 @@ test_expect_success '--amend option with missing author' '
test_when_finished "git checkout Initial" && test_when_finished "git checkout Initial" &&
echo "Missing author test" >>foo && echo "Missing author test" >>foo &&
test_tick && test_tick &&
! git commit -a -m "malformed author" --amend 2>err && test_must_fail git commit -a -m "malformed author" --amend 2>err &&
grep "empty ident" err grep "empty ident" err
' '
......
...@@ -31,7 +31,7 @@ test_expect_success 'setup' ' ...@@ -31,7 +31,7 @@ test_expect_success 'setup' '
test_expect_success 'will not overwrite untracked file' ' test_expect_success 'will not overwrite untracked file' '
git reset --hard c1 && git reset --hard c1 &&
cat important > c2.c && cat important > c2.c &&
! git merge c2 && test_must_fail git merge c2 &&
test_cmp important c2.c test_cmp important c2.c
' '
...@@ -39,7 +39,7 @@ test_expect_success 'will not overwrite new file' ' ...@@ -39,7 +39,7 @@ test_expect_success 'will not overwrite new file' '
git reset --hard c1 && git reset --hard c1 &&
cat important > c2.c && cat important > c2.c &&
git add c2.c && git add c2.c &&
! git merge c2 && test_must_fail git merge c2 &&
test_cmp important c2.c test_cmp important c2.c
' '
...@@ -48,7 +48,7 @@ test_expect_success 'will not overwrite staged changes' ' ...@@ -48,7 +48,7 @@ test_expect_success 'will not overwrite staged changes' '
cat important > c2.c && cat important > c2.c &&
git add c2.c && git add c2.c &&
rm c2.c && rm c2.c &&
! git merge c2 && test_must_fail git merge c2 &&
git checkout c2.c && git checkout c2.c &&
test_cmp important c2.c test_cmp important c2.c
' '
...@@ -58,7 +58,7 @@ test_expect_success 'will not overwrite removed file' ' ...@@ -58,7 +58,7 @@ test_expect_success 'will not overwrite removed file' '
git rm c1.c && git rm c1.c &&
git commit -m "rm c1.c" && git commit -m "rm c1.c" &&
cat important > c1.c && cat important > c1.c &&
! git merge c1a && test_must_fail git merge c1a &&
test_cmp important c1.c test_cmp important c1.c
' '
...@@ -68,7 +68,7 @@ test_expect_success 'will not overwrite re-added file' ' ...@@ -68,7 +68,7 @@ test_expect_success 'will not overwrite re-added file' '
git commit -m "rm c1.c" && git commit -m "rm c1.c" &&
cat important > c1.c && cat important > c1.c &&
git add c1.c && git add c1.c &&
! git merge c1a && test_must_fail git merge c1a &&
test_cmp important c1.c test_cmp important c1.c
' '
...@@ -79,7 +79,7 @@ test_expect_success 'will not overwrite removed file with staged changes' ' ...@@ -79,7 +79,7 @@ test_expect_success 'will not overwrite removed file with staged changes' '
cat important > c1.c && cat important > c1.c &&
git add c1.c && git add c1.c &&
rm c1.c && rm c1.c &&
! git merge c1a && test_must_fail git merge c1a &&
git checkout c1.c && git checkout c1.c &&
test_cmp important c1.c test_cmp important c1.c
' '
......
...@@ -65,7 +65,7 @@ do ...@@ -65,7 +65,7 @@ do
test_expect_success "grep -w $L (w)" ' test_expect_success "grep -w $L (w)" '
: >expected && : >expected &&
! git grep -n -w -e "^w" >actual && test_must_fail git grep -n -w -e "^w" >actual &&
test_cmp expected actual test_cmp expected actual
' '
......
...@@ -20,7 +20,7 @@ test_expect_success 'setup svnrepo' ' ...@@ -20,7 +20,7 @@ test_expect_success 'setup svnrepo' '
' '
test_expect_success 'start import with incomplete authors file' ' test_expect_success 'start import with incomplete authors file' '
! git svn clone --authors-file=svn-authors "$svnrepo" x test_must_fail git svn clone --authors-file=svn-authors "$svnrepo" x
' '
test_expect_success 'imported 2 revisions successfully' ' test_expect_success 'imported 2 revisions successfully' '
...@@ -63,7 +63,7 @@ test_expect_success 'authors-file against globs' ' ...@@ -63,7 +63,7 @@ test_expect_success 'authors-file against globs' '
' '
test_expect_success 'fetch fails on ee' ' test_expect_success 'fetch fails on ee' '
( cd aa-work && ! git svn fetch --authors-file=../svn-authors ) ( cd aa-work && test_must_fail git svn fetch --authors-file=../svn-authors )
' '
tmp_config_get () { tmp_config_get () {
......
...@@ -39,7 +39,7 @@ do ...@@ -39,7 +39,7 @@ do
( (
cd $H && cd $H &&
git config --unset i18n.commitencoding && git config --unset i18n.commitencoding &&
! git svn dcommit test_must_fail git svn dcommit
) )
' '
done done
......
...@@ -41,7 +41,7 @@ test_expect_success 'modify hidden file in SVN repo' ' ...@@ -41,7 +41,7 @@ test_expect_success 'modify hidden file in SVN repo' '
test_expect_success 'fetch fails on modified hidden file' ' test_expect_success 'fetch fails on modified hidden file' '
( cd g && ( cd g &&
git svn find-rev refs/remotes/git-svn > ../expect && git svn find-rev refs/remotes/git-svn > ../expect &&
! git svn fetch 2> ../errors && test_must_fail git svn fetch 2> ../errors &&
git svn find-rev refs/remotes/git-svn > ../expect2 ) && git svn find-rev refs/remotes/git-svn > ../expect2 ) &&
fgrep "not found in commit" errors && fgrep "not found in commit" errors &&
test_cmp expect expect2 test_cmp expect expect2
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册