MCPcopy
hub / github.com/django/django / test_escape

Method test_escape

tests/utils_tests/test_regex_helper.py:15–19  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

13 self.assertEqual(result, expected)
14
15 def test_escape(self):
16 pattern = r"\\\^\$\.\|\?\*\+\(\)\["
17 expected = [("\\^$.|?*+()[", [])]
18 result = regex_helper.normalize(pattern)
19 self.assertEqual(result, expected)
20
21 def test_group_positional(self):
22 pattern = r"(.*)-(.+)"

Callers

nothing calls this directly

Calls 1

normalizeMethod · 0.45

Tested by

no test coverage detected