mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 05:09:23 +01:00
Fixed bug in perlReToReplacer where escaped slashes would stay in the output.
This commit is contained in:
parent
367569f1c7
commit
a0fe5410c0
@ -219,6 +219,7 @@ def perlReToReplacer(s):
|
||||
replacement.
|
||||
"""
|
||||
(kind, regexp, replace, flags) = nonEscapedSlashes.split(s)
|
||||
replace = replace.replace('\\/', '/')
|
||||
if kind != 's':
|
||||
raise ValueError, 'Invalid kind: must be "s"'
|
||||
g = False
|
||||
|
@ -134,6 +134,8 @@ class UtilsTest(unittest.TestCase):
|
||||
self.assertEqual(f('fooba/rba/z'), 'foorz')
|
||||
f = utils.perlReToReplacer('s/cat/dog/i')
|
||||
self.assertEqual(f('CATFISH'), 'dogFISH')
|
||||
f = utils.perlReToReplacer('s/foo/foo\/bar/')
|
||||
self.assertEqual(f('foo'), 'foo/bar')
|
||||
|
||||
def testFindBinaryInPath(self):
|
||||
if os.name == 'posix':
|
||||
|
Loading…
Reference in New Issue
Block a user