def test_repr_small(self, size):
        s = '-' * size
        s = repr(s)
        self.assertEquals(len(s), size + 2)
        self.assertEquals(s[0], "'")
        self.assertEquals(s[-1], "'")
        self.assertEquals(s.count('-'), size)
        del s
        # repr() will create a string four times as large as this 'binary
        # string', but we don't want to allocate much more than twice
        # size in total.  (We do extra testing in test_repr_large())
        size = size // 5 * 2
        s = '\x00' * size
        s = repr(s)
        self.assertEquals(len(s), size * 4 + 2)
        self.assertEquals(s[0], "'")
        self.assertEquals(s[-1], "'")
        self.assertEquals(s.count('\\'), size)
        self.assertEquals(s.count('0'), size * 2)