Пример #1
0
    def testSimpleRangesWithOffsets(self):
        values = ('.,$-10abc',
                    '$-10,.+1abc',
                    '.+10+10,%+1abc',
                    '100+100,1-100abc',)

        for v in values:
            self.assertTrue(EX_PREFIX_RANGE.match(v))

        values = (# This should be illegal.
                  '$+a,%',
                  # Not valid in Vim either.
                  '+100,-100',
                  '%-10,.-10-10',)

        for v in values:
            self.assertFalse(EX_PREFIX_RANGE.match(v))
Пример #2
0
    def testSimpleAddresses(self):
        values = (
                    '%abc',
                    '$abc',
                    '.abc',
                    '1abc',
                    '10abc',
                    '100abc',
                )

        for v in values:
            self.assertTrue(EX_PREFIX_RANGE.match(v))

        values = ('a',
                    ':',)

        for v in values:
            self.assertFalse(EX_PREFIX_RANGE.match(v))
Пример #3
0
    def testIncompleteRanges(self):
        values = (
            '100,abc',
            ',100abc',
            '/foo/+100,abc',
            ',/foo/+100abc',
        )

        for v in values:
            self.assertTrue(EX_PREFIX_RANGE.match(v))
Пример #4
0
    def testComplexRanges(self):
        values = ('/foo/,?bar?abc',
                    '/foo/,/bar/abc',
                    '?foo?,?bar?abc',
                    '/foo/,$abc',
                    '$,/foo/abc',
                    '$,/foo/abc',)

        for v in values:
            self.assertTrue(EX_PREFIX_RANGE.match(v))
Пример #5
0
    def testAddressWithOffsets(self):
        values = ('/foo/+10abc',
                    '/bar/-100abc',
                    '/100/+100abc',
                    '?foo?-10abc',
                    '?bar?+10+10abc',
                    '?100?+10-10abc',)

        for v in values:
            self.assertTrue(EX_PREFIX_RANGE.match(v))
Пример #6
0
    def testAddressBySearchOnly(self):
        values = ('/foo/abc',
                    '/bar/abc',
                    '/100/abc',
                    '?foo?abc',
                    '?bar?abc',
                    '?100?abc',)

        for v in values:
            self.assertTrue(EX_PREFIX_RANGE.match(v))
Пример #7
0
    def testSimpleRanges(self):
        values = (
            '.,$abc',
            '$,.abc',
            '.,%abc',
            '$,%abc',
            '100,1abc',
            '%,.abc',
            '%,$abc',
            '.,abc',
        )

        for v in values:
            self.assertTrue(EX_PREFIX_RANGE.match(v))

        values = ('a,$', )

        for v in values:
            self.assertFalse(EX_PREFIX_RANGE.match(v))
Пример #8
0
    def testIncompleteRanges(self):
        values = (
            '100,abc',
            ',100abc',
            '/foo/+100,abc',
            ',/foo/+100abc',
        )

        for v in values:
            self.assertTrue(EX_PREFIX_RANGE.match(v))
Пример #9
0
    def testSimpleRanges(self):
        values = ('.,$abc',
                    '$,.abc',
                    '.,%abc',
                    '$,%abc',
                    '100,1abc',
                    '%,.abc',
                    '%,$abc',
                    '.,abc',
                )

        for v in values:
            self.assertTrue(EX_PREFIX_RANGE.match(v))

        values = (
                    'a,$',
                )

        for v in values:
            self.assertFalse(EX_PREFIX_RANGE.match(v))
Пример #10
0
    def testSimpleRangesWithOffsets(self):
        values = (
            '.,$-10abc',
            '$-10,.+1abc',
            '.+10+10,%+1abc',
            '100+100,1-100abc',
        )

        for v in values:
            self.assertTrue(EX_PREFIX_RANGE.match(v))

        values = (  # This should be illegal.
            '$+a,%',
            # Not valid in Vim either.
            '+100,-100',
            '%-10,.-10-10',
        )

        for v in values:
            self.assertFalse(EX_PREFIX_RANGE.match(v))
Пример #11
0
    def testSimpleAddresses(self):
        values = (
            '%abc',
            '$abc',
            '.abc',
            '1abc',
            '10abc',
            '100abc',
        )

        for v in values:
            self.assertTrue(EX_PREFIX_RANGE.match(v))

        values = (
            'a',
            ':',
        )

        for v in values:
            self.assertFalse(EX_PREFIX_RANGE.match(v))
Пример #12
0
    def testComplexRanges(self):
        values = (
            '/foo/,?bar?abc',
            '/foo/,/bar/abc',
            '?foo?,?bar?abc',
            '/foo/,$abc',
            '$,/foo/abc',
            '$,/foo/abc',
        )

        for v in values:
            self.assertTrue(EX_PREFIX_RANGE.match(v))
Пример #13
0
    def testAddressWithOffsets(self):
        values = (
            '/foo/+10abc',
            '/bar/-100abc',
            '/100/+100abc',
            '?foo?-10abc',
            '?bar?+10+10abc',
            '?100?+10-10abc',
        )

        for v in values:
            self.assertTrue(EX_PREFIX_RANGE.match(v))
Пример #14
0
    def testAddressBySearchOnly(self):
        values = (
            '/foo/abc',
            '/bar/abc',
            '/100/abc',
            '?foo?abc',
            '?bar?abc',
            '?100?abc',
        )

        for v in values:
            self.assertTrue(EX_PREFIX_RANGE.match(v))