Re: [PATCH 1/2] tests: use shell negation instead of test_must_fail for test_cmp
- Date: Fri, 6 Oct 2017 14:59:26 -0700
- From: Jonathan Nieder <jrnieder@xxxxxxxxx>
- Subject: Re: [PATCH 1/2] tests: use shell negation instead of test_must_fail for test_cmp
Jeff King wrote:
> On Fri, Oct 06, 2017 at 12:00:05PM -0700, Stefan Beller wrote:
>> The `test_must_fail` should only be used to indicate a git command is
>> failing. `test_cmp` is not a git command, such that it doesn't need the
>> special treatment of `test_must_fail` (which e.g. includes checking for
> Hmph. "test_must_fail test_cmp" is a weird thing for somebody to write.
> And your patch is obviously an improvement, but I have to wonder if some
> of these make any sense.
Just for the record: I agree with all the above, and my Reviewed-by
Thanks for looking closer. I wonder if there's a systematic way to
avoid this kind of weak test that can bitrot and still pass too easily
--- e.g. should we have a test_must_differ command with an explanation
of why it should usually be avoided? Would a lint check that bans
this kind of construct completely be going too far?