Re: [PATCHv2 1/8] test-lib: allow negation of prerequisites

2012-11-15 Thread Jeff King
On Wed, Nov 14, 2012 at 11:46:58PM -0800, Jonathan Nieder wrote: +test_expect_success !LAZY_TRUE 'missing lazy prereqs skip tests' ' I have a visceral nervousness when reading this code, from too much unpleasant experience of bash's csh-style !history expansion. Luckily bash does not

Re: [PATCHv2 1/8] test-lib: allow negation of prerequisites

2012-11-15 Thread Jonathan Nieder
Jeff King wrote: Yes. You can test it yourself with bash t-basic.sh. The reason is that the ! is part of history expansion, which is only enabled by default for interactive shells. Nice to hear. Thanks much for looking into it. On Wed, Nov 14, 2012 at 11:46:58PM -0800, Jonathan Nieder

[PATCHv2 1/8] test-lib: allow negation of prerequisites

2012-11-14 Thread Jeff King
You can set and test a prerequisite like this: test_set_prereq FOO test_have_prereq FOO echo yes You can negate the test in the shell like this: ! test_have_prereq echo no However, when you are using the automatic prerequisite checking in test_expect_*, there is no opportunity to use

Re: [PATCHv2 1/8] test-lib: allow negation of prerequisites

2012-11-14 Thread Jonathan Nieder
Jeff King wrote: +test_expect_success !LAZY_TRUE 'missing lazy prereqs skip tests' ' I have a visceral nervousness when reading this code, from too much unpleasant experience of bash's csh-style !history expansion. Luckily bash does not treat ! specially in the '-o sh' mode used by tests.