roarin-roran / Sorting

0 stars 0 forks source link

test mode for mergers #67

Open roarin-roran opened 2 years ago

roarin-roran commented 2 years ago

in test mode, mergers should assert that all input runs are sorted.

also, for peeksort specifically the mergestack merge method should check that runs are maximal, and that the whole input is merged when it's called in test mode.

sebawild commented 2 years ago

Checking for maximal runs when these are found is a good idea. For the later stages, I think this is overly aggressive; one can imagine an input where after one round of merging, the run could be extended, right?

sebawild commented 2 years ago

5,6,7,8,4,3,2,1,9,10,11,12 is such an example. I guess this is an idiosyncrasy of allowing decreasing runs only, right?

roarin-roran commented 2 years ago

oh, I mean very simple tests for the last part. the whole input should be merged after the merge is complete, that sort of thing.

roarin-roran commented 2 years ago

although this will get a little more complicated if #77 is implemented - another reason to create a new archetype there (it can have its own native testing that's separated out from everything else)