in reply to Re^2: Inversion list prototype
in thread Inversion list prototype

I think there are more cases for union.

The two ranges can be disjoint, they can have upper of one == lower of the other, partially overlap, partially overlap with an end-point in common, be equal, be a strict subset and unless you canonicalise the order somehow you also have all of these the other way round (so double the number of cases, plus some I missed probably).

I can think of at least ten cases anyway.

(Edit: after re-reading the tests, I think most cases are covered, so sorry for originally saying "a lot more cases", that was my error in reading the tests)

Replies are listed 'Best First'.
Re^4: Inversion list prototype
by demerphq (Chancellor) on Feb 16, 2007 at 18:19 UTC

    You motivated me to add some more tests just now. I havent named them, but I think i have most covered.

    A second set of eyes is always appreciated in these things, as I think you know. :-)

    ---
    $world=~s/war/peace/g