From: Matt Kraai Date: Fri, 16 Oct 2009 13:39:08 GMT Subject: Re: [PATCH] grep: do not segfault when -f is used Message-ID: <20091016133908.GA3172@ftbfs.org> In-Reply-To: <4AD84C2F.5000809@viscovery.net> On Fri, Oct 16, 2009 at 12:34:23PM +0200, Johannes Sixt wrote: > Matt Kraai schrieb: > > +test_expect_success 'grep should not segfault with -f' ' > > + test_must_fail git grep -f /dev/null > > +' > > there must be a better way to test whether grep -f behaves correctly. How about the following test cases instead? test_expect_success 'grep -f, non-existent file' ' test_must_fail git grep -f patterns ' cat >expected <pattern <actual && test_cmp expected actual ' cat >expected <patterns <actual && test_cmp expected actual ' cat >expected <patterns <actual && test_cmp expected actual ' -- Matt Kraai http://ftbfs.org/