git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Elijah Newren via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: Elijah Newren <newren@palantir.com>, Elijah Newren <newren@palantir.com>
Subject: [PATCH] t6429: fix use of non-existent function
Date: Fri, 01 Jul 2022 05:19:59 +0000	[thread overview]
Message-ID: <pull.1276.git.1656652799863.gitgitgadget@gmail.com> (raw)

From: Elijah Newren <newren@palantir.com>

This test had a line reading

    ! test_file_is_empty actual

which was meant to be

    ! test_must_be_empty actual

The test worked despite the error, because even though
test_file_is_empty is a non-existent function, the '!' negated the
return value and made it pass.  It'd be better to avoid the negation,
so something like

    test_file_not_empty actual

would be better, but perhaps it makes even more sense to specify the
number of lines of expected output to make the test a bit tighter.

Reported-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Elijah Newren <newren@palantir.com>
---
    t6429: fix use of non-existent function
    
    This test had a line reading
    
    ! test_file_is_empty actual
    
    
    which was meant to be
    
    ! test_must_be_empty actual
    
    
    The test worked despite the error, because even though
    test_file_is_empty is a non-existent function, the '!' negated the
    return value and made it pass. It'd be better to avoid the negation, so
    something like
    
    test_file_not_empty actual
    
    
    would be better, but perhaps it makes even more sense to specify the
    number of lines of expected output to make the test a bit tighter.
    
    Reported-by: SZEDER Gábor szeder.dev@gmail.com Signed-off-by: Elijah
    Newren newren@palantir.com

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1276%2Fnewren%2Fmerge-ort-restart-optim-fix-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1276/newren/merge-ort-restart-optim-fix-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/1276

 t/t6429-merge-sequence-rename-caching.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/t6429-merge-sequence-rename-caching.sh b/t/t6429-merge-sequence-rename-caching.sh
index f2bc8a7d2a2..e1ce9199164 100755
--- a/t/t6429-merge-sequence-rename-caching.sh
+++ b/t/t6429-merge-sequence-rename-caching.sh
@@ -760,7 +760,7 @@ test_expect_success 'avoid assuming we detected renames' '
 		test_must_fail git -c merge.renameLimit=1 rebase upstream &&
 
 		git ls-files -u >actual &&
-		! test_file_is_empty actual
+		test_line_count = 2 actual
 	)
 '
 

base-commit: e54793a95afeea1e10de1e5ad7eab914e7416250
-- 
gitgitgadget

                 reply	other threads:[~2022-07-01  5:20 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=pull.1276.git.1656652799863.gitgitgadget@gmail.com \
    --to=gitgitgadget@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=newren@palantir.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).