(self)
| 28 | self.assertEqual(matches, [u'c', u'z']) |
| 29 | |
| 30 | def test_finditer(self): |
| 31 | haystack = u"abc xyz" |
| 32 | pattern = rure.compile(u"\\w+(\\w)") |
| 33 | gen = pattern.finditer(haystack) |
| 34 | match = next(gen) |
| 35 | self.assertIsNotNone(match) |
| 36 | self.assertEqual(match.captures[0], RureMatch(0, 3)) |
| 37 | match = next(gen) |
| 38 | self.assertIsNotNone(match) |
| 39 | self.assertEqual(match.captures[-1], RureMatch(6, 7)) |
| 40 | |
| 41 | def test_nonmatching_captures(self): |
| 42 | ptn = u"(re).*(ger)" |