Re: [PATCH 03/16] t2018: use test_must_fail for failing git commands
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Dec 28, 2019, 07:55 UTC
- Message-ID
- <CAPig+cQo1nbRo=n8-XOtycGijj3k1y_Zozu7VW-WTSBB9LncqQ@mail.gmail.com>
- In-Reply-To
- <c584c9a52b492db2128846e86afb0aadddd6f2de.1577454401.git.liu.denton@gmail.com>
On Fri, Dec 27, 2019 at 8:47 AM Denton Liu <liu.denton@gmail.com> 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 arguments/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?