Re: [RFC] test-lib: detect common misuse of test_expect_failure

2016-10-17 Thread Junio C Hamano
Jeff King writes: > I like the general idea, but I'm not sure how this would interact with > the tests in t that test the test suite. I tried but gave up adding a new test for this to t ;-) >> test_expect_failure () { >> +if test "$test_in_progress" = 1 >> +then >> +

Re: [RFC] test-lib: detect common misuse of test_expect_failure

2016-10-14 Thread Jeff King
On Fri, Oct 14, 2016 at 03:38:41PM -0700, Junio C Hamano wrote: > It is a very easy mistake to make to say test_expect_failure when > making sure a step in the test fails, which must be spelled > "test_must_fail". By introducing a toggle $test_in_progress that is > turned on at the beginning of t

[RFC] test-lib: detect common misuse of test_expect_failure

2016-10-14 Thread Junio C Hamano
It is a very easy mistake to make to say test_expect_failure when making sure a step in the test fails, which must be spelled "test_must_fail". By introducing a toggle $test_in_progress that is turned on at the beginning of test_start_() and off at the end of test_finish_() helper, we can detect t