Ejemplo n.º 1
0
    def testSimpleAddresses(self):
        values = (
                '%',
                '$',
                '.',
                '1',
                '10',
                '100',
                '+100',
                '-100',
                )

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

        self.assertFalse(EX_STANDALONE_RANGE.match('a'))
Ejemplo n.º 2
0
    def testSimpleAddresses(self):
        values = (
            '%',
            '$',
            '.',
            '1',
            '10',
            '100',
            '+100',
            '-100',
        )

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

        self.assertFalse(EX_STANDALONE_RANGE.match('a'))
Ejemplo n.º 3
0
    def testSimpleRanges(self):
        values = ('.,$',
                    '$,.',
                    '%,.',
                    '.,%',
                    '$,%',
                    '%,$',
                    # FIXME: This one is legal in Vim, but I don't what it does.
                    '.,',
                    ',.',
                    '100,1',)

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

        self.assertFalse(EX_STANDALONE_RANGE.match('a,$'))
        self.assertFalse(EX_STANDALONE_RANGE.match('$,qwertyzt'))
Ejemplo n.º 4
0
    def testSimpleRangesWithOffsets(self):
        values = ('.,$-10',
        '$-10,.+1',
        '.+10,%+1',
        '100+100,1-100',
        '+100,-100',
        # According to Vim, this should be illegal (command error).
        '%-10,.-10',)

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

        values = (
                    # FIXME: This should be illegal.
                    '$+a,%',)

        for v in values:
            self.assertFalse(EX_STANDALONE_RANGE.match(v))
Ejemplo n.º 5
0
    def testComplexRanges(self):
        values = ('/foo/,?bar?',
                    '/foo/,/bar/',
                    '?foo?,?bar?',
                    '/foo/,$',
                    '$,/foo/',
                    '$,/foo/',)

        for v in values:
            self.assertTrue(EX_STANDALONE_RANGE.match(v))
Ejemplo n.º 6
0
    def testAddressWithOffsets(self):
        values = ('/foo/+10',
                '/bar/-100',
                '/100/+100',
                '?foo?-10',
                '?bar?+10+10',
                '?100?+10-10',)

        for v in values:
            self.assertTrue(EX_STANDALONE_RANGE.match(v))
Ejemplo n.º 7
0
    def testAddressBySearchOnly(self):
        values =  ('/foo/',
                    '/bar/',
                    '/100/',
                    '?foo?',
                    '?bar?',
                    '?100?',)

        for v in values:
            self.assertTrue(EX_STANDALONE_RANGE.match(v))
Ejemplo n.º 8
0
    def testSimpleRanges(self):
        values = (
            '.,$',
            '$,.',
            '%,.',
            '.,%',
            '$,%',
            '%,$',
            # FIXME: This one is legal in Vim, but I don't what it does.
            '.,',
            ',.',
            '100,1',
        )

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

        self.assertFalse(EX_STANDALONE_RANGE.match('a,$'))
        self.assertFalse(EX_STANDALONE_RANGE.match('$,qwertyzt'))
Ejemplo n.º 9
0
    def testSimpleRangesWithOffsets(self):
        values = (
            '.,$-10',
            '$-10,.+1',
            '.+10,%+1',
            '100+100,1-100',
            '+100,-100',
            # According to Vim, this should be illegal (command error).
            '%-10,.-10',
        )

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

        values = (
            # FIXME: This should be illegal.
            '$+a,%', )

        for v in values:
            self.assertFalse(EX_STANDALONE_RANGE.match(v))
Ejemplo n.º 10
0
    def testComplexRanges(self):
        values = (
            '/foo/,?bar?',
            '/foo/,/bar/',
            '?foo?,?bar?',
            '/foo/,$',
            '$,/foo/',
            '$,/foo/',
        )

        for v in values:
            self.assertTrue(EX_STANDALONE_RANGE.match(v))
Ejemplo n.º 11
0
    def testAddressWithOffsets(self):
        values = (
            '/foo/+10',
            '/bar/-100',
            '/100/+100',
            '?foo?-10',
            '?bar?+10+10',
            '?100?+10-10',
        )

        for v in values:
            self.assertTrue(EX_STANDALONE_RANGE.match(v))
Ejemplo n.º 12
0
    def testAddressBySearchOnly(self):
        values = (
            '/foo/',
            '/bar/',
            '/100/',
            '?foo?',
            '?bar?',
            '?100?',
        )

        for v in values:
            self.assertTrue(EX_STANDALONE_RANGE.match(v))
Ejemplo n.º 13
0
    def testIncompleteRanges(self):
        values = (
            '100,',
            '+100,',
            '-100,',
            ',100',
            ',+100',
            ',-100',
            '100+100,',
            ',100+100',
            ',/foo/+100',
            '/foo/+100,',
        )

        for v in values:
            self.assertTrue(EX_STANDALONE_RANGE.match(v))
Ejemplo n.º 14
0
    def testIncompleteRanges(self):
        values = (
            '100,',
            '+100,',
            '-100,',
            ',100',
            ',+100',
            ',-100',
            '100+100,',
            ',100+100',
            ',/foo/+100',
            '/foo/+100,',
        )

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