Re: [PATCH v2 1/2] t7700: check post-condition in kept-pack test
- From
Taylor Blau <me@ttaylorr.com>
- Date
- Mar 25, 2022, 17:36 UTC
- Message-ID
- <Yj39lEzd/9AwQJaP@nand.local>
- In-Reply-To
- <3fab1246-1451-597c-4359-c01f9675e3f1@github.com>
On Fri, Mar 25, 2022 at 01:23:27PM -0400, Derrick Stolee wrote:
Show 14 quoted lines
> > Since we've made sure "before" is a one-liner earlier, we could just
> > say
>
> > test_cmp before kept &&
> >
> > instead, no?
>
> 'before' contains a .idx name and 'kept' contains a .keep name,
> so this direct comparison does not work. We could do that
> additional check like this:
>
> kept_name=$(cat kept) &&
> echo ${kept_name%.keep}.idx >kept-idx &&
> test_cmp before kept-idx &&I think keeping this kind of post-condition check pretty minimal is favorable, since this is functionality of `git repack` (i.e., that `-a` leaves you with one kept) that is already tested thoroughly elsewhere.
So I'd probably avoid checking the output altogether, but if we did want to test it, I think something as quick and cheap as:
test_line_count = 1 before
would do the trick.
Thanks, Taylor