예제 #1
0
파일: test_build.py 프로젝트: B-Rich/dxr
 def test_misbalanced(self):
     """Make sure we cleanly excise a tag pair from a pair of interleaved
     tags."""
     # A  _________          (2, 6)
     # B        ____________ (5, 9)
     a = Ref("a")
     b = Ref("b")
     tags = [(2, True, a), (5, True, b), (6, False, a), (9, False, b)]
     with catch_warnings():
         warnings.simplefilter("ignore")
         remove_overlapping_refs(tags)
     eq_(tags, [(2, True, a), (6, False, a)])
예제 #2
0
 def test_misbalanced(self):
     """Make sure we cleanly excise a tag pair from a pair of interleaved
     tags."""
     # A  _________          (2, 6)
     # B        ____________ (5, 9)
     a = Ref('a')
     b = Ref('b')
     tags = [(2, True, a), (5, True, b), (6, False, a), (9, False, b)]
     with catch_warnings():
         warnings.simplefilter('ignore')
         remove_overlapping_refs(tags)
     eq_(tags, [(2, True, a), (6, False, a)])
예제 #3
0
파일: test_build.py 프로젝트: B-Rich/dxr
    def test_overlapping_regions(self):
        """Regions (as opposed to refs) are allowed to overlap and shouldn't be
        disturbed::

            A           _________          (2, 6)
            B (region)        ____________ (5, 9)

        """
        a = Ref("a")
        b = Region("b")
        tags = [(2, True, a), (5, True, b), (6, False, a), (9, False, b)]
        original_tags = tags[:]
        remove_overlapping_refs(tags)
        eq_(tags, original_tags)
예제 #4
0
    def test_overlapping_regions(self):
        """Regions (as opposed to refs) are allowed to overlap and shouldn't be
        disturbed::

            A           _________          (2, 6)
            B (region)        ____________ (5, 9)

        """
        a = Ref('a')
        b = Region('b')
        tags = [(2, True, a), (5, True, b), (6, False, a), (9, False, b)]
        original_tags = tags[:]
        remove_overlapping_refs(tags)
        eq_(tags, original_tags)