git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 0/3] fix use of "! test_path_is_foo" in tests

From
Junio C Hamano <gitster@pobox.com>
Date
May 16, 2023, 02:26 UTC
Message-ID
<20230516022646.648123-1-gitster@pobox.com>

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
Next: Junio C Hamano
Message 1 of 6 in “fix use of "! test_path_is_foo" in tests”
  1. 0/3 fix use of "! test_path_is_foo" in testsJunio C Hamano, May 16, 2023
  2. 1/3 tests: do not negate test_path_existsJunio C Hamano, May 16, 2023
  3. Eric SunshineMay 16, 2023
  4. Junio C HamanoMay 16, 2023
  5. 3/3 test: do not negate test_path_is_* to assert absenseJunio C Hamano, May 16, 2023
  6. 2/3 t2021: do not negate test_path_is_dirJunio C Hamano, May 16, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.