Example #1
0
def test_interval_union_simplification_three_step_connected():
    iu = IntervalUnion([[0, 1], [2, 3], [4, 5], [1, 1337]])
    iu._simplify()
    assert iu.intervals == [Interval(0, 1337)]
Example #2
0
def test_interval_union_simplification_disjoint():
    iu = IntervalUnion([[0, 1], [42, 1337]])
    iu._simplify()
    assert iu.intervals == [Interval(0, 1), Interval(42, 1337)]
Example #3
0
def test_interval_union_simplification_overlap_connected():
    iu = IntervalUnion([[0, 3], [1, 1337]])
    iu._simplify()
    assert iu.intervals == [Interval(0, 1337)]
Example #4
0
def test_interval_union_simplification_empty():
    iu = IntervalUnion([])
    iu._simplify()
    assert iu.intervals == []