Thread (4 messages) flat view 4 messages, 3 authors, 2016-06-15

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

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:49:16

Possibly related (same subject, not in this thread)

Matthieu Moy [off-list ref] 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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help