(self)
| 248 | self.assertFalse(re.match(fatre, 'dabccbad')) |
| 249 | |
| 250 | def test_translate_wildcards(self): |
| 251 | for pattern, expect in [ |
| 252 | ('ab*', r'(?s:ab.*)\z'), |
| 253 | ('ab*cd', r'(?s:ab.*cd)\z'), |
| 254 | ('ab*cd*', r'(?s:ab(?>.*?cd).*)\z'), |
| 255 | ('ab*cd*12', r'(?s:ab(?>.*?cd).*12)\z'), |
| 256 | ('ab*cd*12*', r'(?s:ab(?>.*?cd)(?>.*?12).*)\z'), |
| 257 | ('ab*cd*12*34', r'(?s:ab(?>.*?cd)(?>.*?12).*34)\z'), |
| 258 | ('ab*cd*12*34*', r'(?s:ab(?>.*?cd)(?>.*?12)(?>.*?34).*)\z'), |
| 259 | ]: |
| 260 | with self.subTest(pattern): |
| 261 | translated = translate(pattern) |
| 262 | self.assertEqual(translated, expect, pattern) |
| 263 | |
| 264 | for pattern, expect in [ |
| 265 | ('*ab', r'(?s:.*ab)\z'), |
| 266 | ('*ab*', r'(?s:(?>.*?ab).*)\z'), |
| 267 | ('*ab*cd', r'(?s:(?>.*?ab).*cd)\z'), |
| 268 | ('*ab*cd*', r'(?s:(?>.*?ab)(?>.*?cd).*)\z'), |
| 269 | ('*ab*cd*12', r'(?s:(?>.*?ab)(?>.*?cd).*12)\z'), |
| 270 | ('*ab*cd*12*', r'(?s:(?>.*?ab)(?>.*?cd)(?>.*?12).*)\z'), |
| 271 | ('*ab*cd*12*34', r'(?s:(?>.*?ab)(?>.*?cd)(?>.*?12).*34)\z'), |
| 272 | ('*ab*cd*12*34*', r'(?s:(?>.*?ab)(?>.*?cd)(?>.*?12)(?>.*?34).*)\z'), |
| 273 | ]: |
| 274 | with self.subTest(pattern): |
| 275 | translated = translate(pattern) |
| 276 | self.assertEqual(translated, expect, pattern) |
| 277 | |
| 278 | def test_translate_expressions(self): |
| 279 | for pattern, expect in [ |
nothing calls this directly
no test coverage detected