Thread (45 messages) 45 messages, 3 authors, 2020-01-26

Re: [PATCH 03/16] t2018: use test_must_fail for failing git commands

From: Eric Sunshine <hidden>
Date: 2019-12-28 07:55:39

On Fri, Dec 27, 2019 at 8:47 AM Denton Liu [off-list ref] wrote:
We had some instances of `test_must_fail test_dirty_{un,}mergable`.
However, `test_must_fail` should only be used on git commands. Teach
test_dirty_{un,}mergable() to accept `!` as a potential first argument
s/mergable/mergeable/ twice above.
which will run the git command without test_must_fail(). This prevents
the double-negation where we were effectively running
`test_must_fail test_must_fail git diff ...`.
This change makes the situation even more confusing than it already
is. For instance, you can now say:

    test_dirty_unmergable !

which effectively says "not unmergeable", which is the same as "not
not mergeable". Does that mean it is mergeable? Does that mean it
should be calling test_dirty_mergeable()? Same situation arises with:

    test_dirty_mergeable !

It seems like there are four distinct cases that are being tested
here. If that's so, then rather than changing these functions to
accept "!" as an argument, perhaps there should be four distinct
one-liner functions for testing those cases?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help