tests: Say "pass" rather than "ok" on empty lines for TAP
Lines that begin with "ok" confuse the TAP harness because it can't distinguish them from a test counter. Work around the issue by saying "pass" instead, which isn't a reserved TAP word. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
fadb5156e4
commit
335f87871f
@ -24,18 +24,18 @@ test_expect_success 'update-index and ls-files' '
|
|||||||
cd "$HERE" &&
|
cd "$HERE" &&
|
||||||
git update-index --add one &&
|
git update-index --add one &&
|
||||||
case "`git ls-files`" in
|
case "`git ls-files`" in
|
||||||
one) echo ok one ;;
|
one) echo pass one ;;
|
||||||
*) echo bad one; exit 1 ;;
|
*) echo bad one; exit 1 ;;
|
||||||
esac &&
|
esac &&
|
||||||
cd dir &&
|
cd dir &&
|
||||||
git update-index --add two &&
|
git update-index --add two &&
|
||||||
case "`git ls-files`" in
|
case "`git ls-files`" in
|
||||||
two) echo ok two ;;
|
two) echo pass two ;;
|
||||||
*) echo bad two; exit 1 ;;
|
*) echo bad two; exit 1 ;;
|
||||||
esac &&
|
esac &&
|
||||||
cd .. &&
|
cd .. &&
|
||||||
case "`git ls-files`" in
|
case "`git ls-files`" in
|
||||||
dir/two"$LF"one) echo ok both ;;
|
dir/two"$LF"one) echo pass both ;;
|
||||||
*) echo bad; exit 1 ;;
|
*) echo bad; exit 1 ;;
|
||||||
esac
|
esac
|
||||||
'
|
'
|
||||||
@ -58,17 +58,17 @@ test_expect_success 'diff-files' '
|
|||||||
echo a >>one &&
|
echo a >>one &&
|
||||||
echo d >>dir/two &&
|
echo d >>dir/two &&
|
||||||
case "`git diff-files --name-only`" in
|
case "`git diff-files --name-only`" in
|
||||||
dir/two"$LF"one) echo ok top ;;
|
dir/two"$LF"one) echo pass top ;;
|
||||||
*) echo bad top; exit 1 ;;
|
*) echo bad top; exit 1 ;;
|
||||||
esac &&
|
esac &&
|
||||||
# diff should not omit leading paths
|
# diff should not omit leading paths
|
||||||
cd dir &&
|
cd dir &&
|
||||||
case "`git diff-files --name-only`" in
|
case "`git diff-files --name-only`" in
|
||||||
dir/two"$LF"one) echo ok subdir ;;
|
dir/two"$LF"one) echo pass subdir ;;
|
||||||
*) echo bad subdir; exit 1 ;;
|
*) echo bad subdir; exit 1 ;;
|
||||||
esac &&
|
esac &&
|
||||||
case "`git diff-files --name-only .`" in
|
case "`git diff-files --name-only .`" in
|
||||||
dir/two) echo ok subdir limited ;;
|
dir/two) echo pass subdir limited ;;
|
||||||
*) echo bad subdir limited; exit 1 ;;
|
*) echo bad subdir limited; exit 1 ;;
|
||||||
esac
|
esac
|
||||||
'
|
'
|
||||||
|
@ -24,7 +24,7 @@ git update-index symlink'
|
|||||||
test_expect_success \
|
test_expect_success \
|
||||||
'the index entry must still be a symbolic link' '
|
'the index entry must still be a symbolic link' '
|
||||||
case "`git ls-files --stage --cached symlink`" in
|
case "`git ls-files --stage --cached symlink`" in
|
||||||
120000" "*symlink) echo ok;;
|
120000" "*symlink) echo pass;;
|
||||||
*) echo fail; git ls-files --stage --cached symlink; (exit 1);;
|
*) echo fail; git ls-files --stage --cached symlink; (exit 1);;
|
||||||
esac'
|
esac'
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ test_expect_success \
|
|||||||
chmod 755 xfoo1 &&
|
chmod 755 xfoo1 &&
|
||||||
git add xfoo1 &&
|
git add xfoo1 &&
|
||||||
case "`git ls-files --stage xfoo1`" in
|
case "`git ls-files --stage xfoo1`" in
|
||||||
100644" "*xfoo1) echo ok;;
|
100644" "*xfoo1) echo pass;;
|
||||||
*) echo fail; git ls-files --stage xfoo1; (exit 1);;
|
*) echo fail; git ls-files --stage xfoo1; (exit 1);;
|
||||||
esac'
|
esac'
|
||||||
|
|
||||||
@ -35,7 +35,7 @@ test_expect_success SYMLINKS 'git add: filemode=0 should not get confused by sym
|
|||||||
ln -s foo xfoo1 &&
|
ln -s foo xfoo1 &&
|
||||||
git add xfoo1 &&
|
git add xfoo1 &&
|
||||||
case "`git ls-files --stage xfoo1`" in
|
case "`git ls-files --stage xfoo1`" in
|
||||||
120000" "*xfoo1) echo ok;;
|
120000" "*xfoo1) echo pass;;
|
||||||
*) echo fail; git ls-files --stage xfoo1; (exit 1);;
|
*) echo fail; git ls-files --stage xfoo1; (exit 1);;
|
||||||
esac
|
esac
|
||||||
'
|
'
|
||||||
@ -47,7 +47,7 @@ test_expect_success \
|
|||||||
chmod 755 xfoo2 &&
|
chmod 755 xfoo2 &&
|
||||||
git update-index --add xfoo2 &&
|
git update-index --add xfoo2 &&
|
||||||
case "`git ls-files --stage xfoo2`" in
|
case "`git ls-files --stage xfoo2`" in
|
||||||
100644" "*xfoo2) echo ok;;
|
100644" "*xfoo2) echo pass;;
|
||||||
*) echo fail; git ls-files --stage xfoo2; (exit 1);;
|
*) echo fail; git ls-files --stage xfoo2; (exit 1);;
|
||||||
esac'
|
esac'
|
||||||
|
|
||||||
@ -56,7 +56,7 @@ test_expect_success SYMLINKS 'git add: filemode=0 should not get confused by sym
|
|||||||
ln -s foo xfoo2 &&
|
ln -s foo xfoo2 &&
|
||||||
git update-index --add xfoo2 &&
|
git update-index --add xfoo2 &&
|
||||||
case "`git ls-files --stage xfoo2`" in
|
case "`git ls-files --stage xfoo2`" in
|
||||||
120000" "*xfoo2) echo ok;;
|
120000" "*xfoo2) echo pass;;
|
||||||
*) echo fail; git ls-files --stage xfoo2; (exit 1);;
|
*) echo fail; git ls-files --stage xfoo2; (exit 1);;
|
||||||
esac
|
esac
|
||||||
'
|
'
|
||||||
@ -67,7 +67,7 @@ test_expect_success SYMLINKS \
|
|||||||
ln -s xfoo2 xfoo3 &&
|
ln -s xfoo2 xfoo3 &&
|
||||||
git update-index --add xfoo3 &&
|
git update-index --add xfoo3 &&
|
||||||
case "`git ls-files --stage xfoo3`" in
|
case "`git ls-files --stage xfoo3`" in
|
||||||
120000" "*xfoo3) echo ok;;
|
120000" "*xfoo3) echo pass;;
|
||||||
*) echo fail; git ls-files --stage xfoo3; (exit 1);;
|
*) echo fail; git ls-files --stage xfoo3; (exit 1);;
|
||||||
esac'
|
esac'
|
||||||
|
|
||||||
@ -172,7 +172,7 @@ test_expect_success 'git add --refresh' '
|
|||||||
test -z "`git diff-index HEAD -- foo`" &&
|
test -z "`git diff-index HEAD -- foo`" &&
|
||||||
git read-tree HEAD &&
|
git read-tree HEAD &&
|
||||||
case "`git diff-index HEAD -- foo`" in
|
case "`git diff-index HEAD -- foo`" in
|
||||||
:100644" "*"M foo") echo ok;;
|
:100644" "*"M foo") echo pass;;
|
||||||
*) echo fail; (exit 1);;
|
*) echo fail; (exit 1);;
|
||||||
esac &&
|
esac &&
|
||||||
git add --refresh -- foo &&
|
git add --refresh -- foo &&
|
||||||
|
Loading…
x
Reference in New Issue
Block a user