Esempio n. 1
0
 def xtest_backslashes_alone(self):
     """
     Should insert a properly numbered backslashes in place of $
     backreferences
     """
     self.assertEquals(r'\0\2\100',
                       _switch_backreferences(r'$0$2$100'))
Esempio n. 2
0
 def xtest_backslashes_in_string(self):
     """
     Should insert a properly numbered backslashes in place of $
     backreferences
     """
     self.assertEquals(r'foo\0bar\2baz\g100boo',
                       _switch_backreferences(r'foo$0bar$2baz$100boo'))
Esempio n. 3
0
 def test_backslash_in_string(self):
     """
     Should insert a properly numbered backslash in place of $ reference
     in midst of string
     """
     self.assertEquals(r'foo\0bar',
                       _switch_backreferences(r'foo$0bar'))
Esempio n. 4
0
 def test_backslash_alone(self):
     """
     Should insert a properly numbered backslash in place of single $
     backreference
     """
     self.assertEquals(r'\0', _switch_backreferences(r'$0'))
Esempio n. 5
0
 def test_not_escapes(self):
     """
     We should not escape $ when it's followed by something else
     """
     self.assertEquals(r'\$foo', _switch_backreferences(r'\$foo'))
Esempio n. 6
0
 def test_escapes(self):
     """
     We should be able to escape $ when followed by numbers
     """
     self.assertEquals('$100', _switch_backreferences(r'\$100'))
Esempio n. 7
0
 def test_no_bs(self):
     """
     Appropriate name.  Should do nothing.
     """
     self.assertEquals('foobar', _switch_backreferences('foobar'))