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 fooI 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.