Git Mailing List Archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] fix use of "! test_path_is_foo" in tests
@ 2023-05-16  2:26 Junio C Hamano
  2023-05-16  2:26 ` [PATCH 1/3] tests: do not negate test_path_exists Junio C Hamano
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Junio C Hamano @ 2023-05-16  2:26 UTC (permalink / raw)
  To: git

During recent review of a topic, I noticed that there are a handful
of places where we misuse test_path_is_{file,directory} test helper
functions.  They are designed to be silent when the given path is
of the expected type, so

	! test_path_is_file foo

when you do not want 'foo' to be a file, while making the test pass,
does not help debugging when things go wrong.

These small patches touch the places where

	$ git grep -e '! test_path_' t/

shows hits, except for test_path_is_hidden that shares the same name
pattern but is not designed to help debugging like others.

Junio C Hamano (3):
  tests: do not negate test_path_exists
  t2021: do not negate test_path_is_dir
  test: do not negate test_path_is_* to assert absense

 t/lib-submodule-update.sh     | 2 +-
 t/t2021-checkout-overwrite.sh | 2 +-
 t/t4067-diff-partial-clone.sh | 4 ++--
 t/t4115-apply-symlink.sh      | 2 +-
 t/t5572-pull-submodule.sh     | 4 ++--
 5 files changed, 7 insertions(+), 7 deletions(-)

-- 
2.41.0-rc0


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-05-16 16:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-16  2:26 [PATCH 0/3] fix use of "! test_path_is_foo" in tests Junio C Hamano
2023-05-16  2:26 ` [PATCH 1/3] tests: do not negate test_path_exists Junio C Hamano
2023-05-16  2:53   ` Eric Sunshine
2023-05-16 16:10     ` Junio C Hamano
2023-05-16  2:26 ` [PATCH 2/3] t2021: do not negate test_path_is_dir Junio C Hamano
2023-05-16  2:26 ` [PATCH 3/3] test: do not negate test_path_is_* to assert absense Junio C Hamano

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 read-only IMAP folder(s) and NNTP newsgroup(s).