[PATCHv2 05/21] completion tests: check __gitdir()'s output in the error cases
- From
SZEDER Gábor <szeder.dev@gmail.com>
- Date
- Feb 3, 2017, 02:48 UTC
- Message-ID
- <20170203024829.8071-6-szeder.dev@gmail.com>
- In-Reply-To
- <20170203024829.8071-1-szeder.dev@gmail.com>
The __gitdir() helper function shouldn't output anything if not in a git repository. The relevant tests only checked its error code, so extend them to ensure that there's no output.
Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com> --- t/t9902-completion.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh index 030a16e77..f7f7d49fb 100755 --- a/t/t9902-completion.sh +++ b/t/t9902-completion.sh @@ -215,8 +215,9 @@ test_expect_success '__gitdir - non-existing $GIT_DIR' ' ( GIT_DIR="$ROOT/non-existing" && export GIT_DIR && - test_must_fail __gitdir - ) + test_must_fail __gitdir >"$actual" + ) && + test_must_be_empty "$actual" ' test_expect_success '__gitdir - gitfile in cwd' ' @@ -255,7 +256,8 @@ test_expect_success SYMLINKS '__gitdir - resulting path avoids symlinks' ' ' test_expect_success '__gitdir - not a git repository' ' - nongit test_must_fail __gitdir + nongit test_must_fail __gitdir >"$actual" && + test_must_be_empty "$actual" ' test_expect_success '__gitcomp - trailing space - options' '
-- 2.11.0.555.g967c1bcb3