Skip to content
Snippets Groups Projects
Commit 4a6ab0f6 authored by Luc Maisonobe's avatar Luc Maisonobe
Browse files

Added test case.

parent 3ee8c148
No related branches found
No related tags found
No related merge requests found
......@@ -30,7 +30,7 @@
<action dev="luc" type="fix" issue="884">
Deprecated TimeSpanMap.getTransitions()
</action>
<action dev="luc" type="fix" issue="885">
<action dev="luc" type="fix" issue="832,885">
Allow to enter the same transition date in TimeSpanMap several times
</action>
<action dev="luc" type="fix" issue="833">
......
......@@ -666,6 +666,21 @@ public class TimeSpanMapTest {
checkCountConsistency(map);
}
@Test
public void testValidAllTime() {
AbsoluteDate ref = AbsoluteDate.ARBITRARY_EPOCH.shiftedBy(1);
TimeSpanMap<Integer> map = new TimeSpanMap<>(0);
// action
map.addValidAfter(1, ref, false);
map.addValidBefore(2, ref, false);
// verify
Assert.assertEquals(1, (int) map.get(ref.shiftedBy(1)));
Assert.assertEquals(2, (int) map.get(ref.shiftedBy(-1)));
Assert.assertEquals(1, (int) map.get(ref));
}
private <T> void checkCountConsistency(final TimeSpanMap<T> map) {
final int count1 = map.getSpansNumber();
int count2 = 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment