Re: [PATCH 1/5] "lib-diff" tests: make "README" and "COPYING" test data smaller
- From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
- Date
- Oct 4, 2021, 17:59 UTC
- Message-ID
- <877desmzzt.fsf@evledraar.gmail.com>
- In-Reply-To
- <CAFQ2z_NwrpMuYmtB1caokup9SCr=od97ONG86c4PWmfEJ5vZCg@mail.gmail.com>
On Mon, Oct 04 2021, Han-Wen Nienhuys wrote:
Show 17 quoted lines
> On Sat, Oct 2, 2021 at 11:19 AM Ævar Arnfjörð Bjarmason > <avarab@gmail.com> wrote: >> >> Follow-up the change in 459b8d22e54 (tests: do not borrow from COPYING >> and README from the real source, 2015-02-15) by not shipping a full >> copy of older versions of the top-level "COPYING" and "README" files. >> >> The tests that use them just need the small blurb at the top of >> "COPYING" as test data, or mock data that's dissimilar. Let's provide >> that with a "COPYING_test_data" function instead. > > I had to read this patch a couple of times before I understood what > was going on. > > Your change is a definite improvement, but if the actual contents > don't matter that much, maybe something like "lorum ipsum" would be > even better.
The actual contents do matter to the existing tests, which e.g. in t4003-diff-rename-1.sh munge the COPYING file and then assert the exact resulting diff output.
Those tests could all be rewritten to use some new better-known test content, but I figured that wasn't worth it in this case, as opposed to just providing them with the data from the opening paragraphs the tests are interested in / faking up a new "README".