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

Re: [PATCH 2/2] test-lib: user-friendly alternatives to test [!] [-d|-f]

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 9, 2010, 16:25 UTC
Message-ID
<7vvd7j7nys.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1281027281-21055-2-git-send-email-Matthieu.Moy@imag.fr>
Matthieu Moy <Matthieu.Moy@imag.fr> writes:
> +   test_file_must_not_exist <file> [<diagnosis>]
> +   test_dir_must_not_exist <dir> [<diagnosis>]
Should either of these pass?
    mkdir foo && test_file_must_not_exist foo
    rm -fr foo && >foo && test_dir_must_not_exist foo

I think in most of the test cases we want to write "must not exist" to make sure what we are supposed to remove is gone, which would mean that (1) we know what that thing is, and (2) we not only just do not want a file "foo" when we say "file-must-not-exist foo", but we don't expect it to be a directory either.

I'd say we would probably want three primitives instead of four:
    test_path_is_file        <path>
    test_path_is_directory   <path>
    test_path_is_missing     <path>
Thanks.
Previous: Ævar Arnfjörð BjarmasonNext: Matthieu Moy
Message 9 of 15 in “rebase -i: add exec command to launch a shell command”
  1. rebase -i: add exec command to launch a shell commandMatthieu Moy, Aug 5, 2010
  2. Ævar Arnfjörð BjarmasonAug 5, 2010
  3. Matthieu MoyAug 5, 2010
  4. 1/2 rebase -i: add exec command to launch a shell commandMatthieu Moy, Aug 5, 2010
  5. 2/2 test-lib: user-friendly alternatives to test [!] [-d|-f]Matthieu Moy, Aug 5, 2010
  6. test-lib: user-friendly alternatives to test [!] [-d|-f]Matthieu Moy, Aug 5, 2010
  7. Jonathan NiederAug 6, 2010
  8. Ævar Arnfjörð BjarmasonAug 7, 2010
  9. Junio C HamanoAug 9, 2010
  10. test-lib: user-friendly alternatives to test [-d|-f|-e]Matthieu Moy, Aug 10, 2010
  11. Joshua JuranAug 10, 2010
  12. test-lib: user-friendly alternatives to test [-d|-f|-e]Matthieu Moy, Aug 10, 2010
  13. Erik Faye-LundAug 5, 2010
  14. Jacob HelwigAug 5, 2010
  15. Junio C HamanoAug 5, 2010

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.