On Wed, Jul 24, 2024 at 09:15:31AM -0700, Junio C Hamano wrote: > Patrick Steinhardt <ps@xxxxxx> writes: > > > One of those reasons that we use the modulo-loops in the other tests is > > so that the order in which entries are added is mixed. Here we add them > > in priority order already, so that makes the test less interesting. We > > might thus want to do the same here and scramble the order a bit. > > Wouldn't modulo-loops mean the total number of elements must be > prime with the skip count, or something, which in turn means that it > is harder to test certain corner cases of the underlying data > structure (e.g. "what if the length is exactly a power of two? A > power of two plus one? A power of two minus one?" etc.) > > It certainly is much better than just inserting in the priority > order (or in the reverse priority order). Yeah. I am not a huge fan of those modulo-loop as they hide what the actual test data is myself, but they are already being used in those tests anyway, and that's why I proposed them. The better option, in my opinion, is to just make the test data explicit by for example looping through an array of input data and inserting it one by one. Patrick
Attachment:
signature.asc
Description: PGP signature