Ejemplo n.º 1
0
    def test_adjacent(self):
        """Adjacent extents should be coalesced.

        This is not important, but it's nice.

        """
        eq_(list(fix_extents_overlap([(1, 7), (7, 10)])), [(1, 10)])
Ejemplo n.º 2
0
    def test_adjacent(self):
        """Adjacent extents should be coalesced.

        This is not important, but it's nice.

        """
        eq_(list(fix_extents_overlap([(1, 7), (7, 10)])),
            [(1, 10)])
Ejemplo n.º 3
0
 def test_zero(self):
     """Work even if the highlighting starts at offset 0."""
     eq_(list(fix_extents_overlap([(0, 3), (2, 5), (11, 14)])),
         [(0, 5), (11, 14)])
Ejemplo n.º 4
0
 def test_short(self):
     """Short inputs should work."""
     eq_(list(fix_extents_overlap([])),
         [])
     eq_(list(fix_extents_overlap([(1, 2)])),
         [(1, 2)])
Ejemplo n.º 5
0
 def test_overlap(self):
     """Overlapping extents should be merged."""
     eq_(list(fix_extents_overlap([(1, 7), (5, 8)])),
         [(1, 8)])
Ejemplo n.º 6
0
 def test_disjoint(self):
     """Disjoint extents should remain unmolested."""
     eq_(list(fix_extents_overlap([(1, 7), (8, 12)])),
         [(1, 7), (8, 12)])
Ejemplo n.º 7
0
 def test_duplicate(self):
     """Duplicate extents should be combined."""
     eq_(list(fix_extents_overlap([(22, 34), (22, 34)])),
         [(22, 34)])
Ejemplo n.º 8
0
 def test_zero(self):
     """Work even if the highlighting starts at offset 0."""
     eq_(list(fix_extents_overlap([(0, 3), (2, 5), (11, 14)])), [(0, 5),
                                                                 (11, 14)])
Ejemplo n.º 9
0
 def test_short(self):
     """Short inputs should work."""
     eq_(list(fix_extents_overlap([])), [])
     eq_(list(fix_extents_overlap([(1, 2)])), [(1, 2)])
Ejemplo n.º 10
0
 def test_overlap(self):
     """Overlapping extents should be merged."""
     eq_(list(fix_extents_overlap([(1, 7), (5, 8)])), [(1, 8)])
Ejemplo n.º 11
0
 def test_disjoint(self):
     """Disjoint extents should remain unmolested."""
     eq_(list(fix_extents_overlap([(1, 7), (8, 12)])), [(1, 7), (8, 12)])
Ejemplo n.º 12
0
 def test_duplicate(self):
     """Duplicate extents should be combined."""
     eq_(list(fix_extents_overlap([(22, 34), (22, 34)])), [(22, 34)])