def test_rfind(self, size):
        SUBSTR = ' abc def ghi'
        sublen = len(SUBSTR)
        s = ''.join([SUBSTR, '-' * size, SUBSTR])
        self.assertEquals(s.rfind(' '), sublen + size + SUBSTR.rfind(' '))
        self.assertEquals(s.rfind(SUBSTR), sublen + size)
        self.assertEquals(s.rfind(' ', 0, size), SUBSTR.rfind(' '))
        self.assertEquals(s.rfind(SUBSTR, 0, sublen + size), 0)
        self.assertEquals(s.rfind('i'), sublen + size + SUBSTR.rfind('i'))
        self.assertEquals(s.rfind('i', 0, sublen), SUBSTR.rfind('i'))
        self.assertEquals(s.rfind('i', 0, sublen + size),
                          SUBSTR.rfind('i'))
        self.assertEquals(s.rfind('j'), -1)