(self, pattern)
| 40 | os_helper.unlink(os_helper.TESTFN) |
| 41 | |
| 42 | def drive_one(self, pattern): |
| 43 | for length in lengths: |
| 44 | # Repeat string 'pattern' as often as needed to reach total length |
| 45 | # 'length'. Then call try_one with that string, a string one larger |
| 46 | # than that, and a string one smaller than that. Try this with all |
| 47 | # small sizes and various powers of 2, so we exercise all likely |
| 48 | # stdio buffer sizes, and "off by one" errors on both sides. |
| 49 | q, r = divmod(length, len(pattern)) |
| 50 | teststring = pattern * q + pattern[:r] |
| 51 | self.assertEqual(len(teststring), length) |
| 52 | self.try_one(teststring) |
| 53 | self.try_one(teststring + b"x") |
| 54 | self.try_one(teststring[:-1]) |
| 55 | |
| 56 | def test_primepat(self): |
| 57 | # A pattern with prime length, to avoid simple relationships with |
no test coverage detected