Details
-
Bug
-
Status: Resolved
-
Normal
-
Resolution: Fixed
-
None
-
None
-
Normal
Description
It's possible that differenceToFetch is making implicit assumptions about the relationship between the two ranges, but the following cases are not handled correctly (the old range is (A, B], the new is (C, D]:
--C--A-----B--D--
Here, the result will be (C, A] and (D, B], instead of (C, A] and (B, D].
--C--A-----D--B--
The result will be (C, D] instead of just (C, A].
--A--C-----D--B--
The result will be (B, D] when nothing needs to be transfered.
If there is some kind of implicit assumption that these cases won't arise, it either needs to be explicit (assertions, exceptions) or the cases need to be handled. It should be easy to cover this with unit tests.