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'))
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'))
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'))
def test_backslash_alone(self): """ Should insert a properly numbered backslash in place of single $ backreference """ self.assertEquals(r'\0', _switch_backreferences(r'$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'))
def test_escapes(self): """ We should be able to escape $ when followed by numbers """ self.assertEquals('$100', _switch_backreferences(r'\$100'))
def test_no_bs(self): """ Appropriate name. Should do nothing. """ self.assertEquals('foobar', _switch_backreferences('foobar'))