Example #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)])
Example #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)])
Example #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)])
Example #4
0
 def test_short(self):
     """Short inputs should work."""
     eq_(list(fix_extents_overlap([])),
         [])
     eq_(list(fix_extents_overlap([(1, 2)])),
         [(1, 2)])
Example #5
0
 def test_overlap(self):
     """Overlapping extents should be merged."""
     eq_(list(fix_extents_overlap([(1, 7), (5, 8)])),
         [(1, 8)])
Example #6
0
 def test_disjoint(self):
     """Disjoint extents should remain unmolested."""
     eq_(list(fix_extents_overlap([(1, 7), (8, 12)])),
         [(1, 7), (8, 12)])
Example #7
0
 def test_duplicate(self):
     """Duplicate extents should be combined."""
     eq_(list(fix_extents_overlap([(22, 34), (22, 34)])),
         [(22, 34)])
Example #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)])
Example #9
0
 def test_short(self):
     """Short inputs should work."""
     eq_(list(fix_extents_overlap([])), [])
     eq_(list(fix_extents_overlap([(1, 2)])), [(1, 2)])
Example #10
0
 def test_overlap(self):
     """Overlapping extents should be merged."""
     eq_(list(fix_extents_overlap([(1, 7), (5, 8)])), [(1, 8)])
Example #11
0
 def test_disjoint(self):
     """Disjoint extents should remain unmolested."""
     eq_(list(fix_extents_overlap([(1, 7), (8, 12)])), [(1, 7), (8, 12)])
Example #12
0
 def test_duplicate(self):
     """Duplicate extents should be combined."""
     eq_(list(fix_extents_overlap([(22, 34), (22, 34)])), [(22, 34)])