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))
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))
def testIncompleteRanges(self): values = ( '100,abc', ',100abc', '/foo/+100,abc', ',/foo/+100abc', ) for v in values: self.assertTrue(EX_PREFIX_RANGE.match(v))
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))
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))
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))
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))
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))
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))
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))
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))
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))
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))