From: SZEDER Gábor Date: Thu, 25 Feb 2016 22:50:34 GMT Subject: [PATCH 05/21] completion tests: check __gitdir()'s output in the error cases Message-ID: <1456440650-32623-6-git-send-email-szeder@ira.uka.de> In-Reply-To: <1456440650-32623-1-git-send-email-szeder@ira.uka.de> 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 --- t/t9902-completion.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh index 447f57b89291..1e8794747efd 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' ' @@ -259,8 +260,9 @@ test_expect_success '__gitdir - not a git repository' ' cd subdir/subsubdir && GIT_CEILING_DIRECTORIES="$ROOT" && export GIT_CEILING_DIRECTORIES && - test_must_fail __gitdir - ) + test_must_fail __gitdir >"$actual" + ) && + test_must_be_empty "$actual" ' test_expect_success '__gitcomp - trailing space - options' ' -- 2.7.2.410.g92cb358