MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_character_set_any

Method test_character_set_any

Lib/test/test_re.py:2684–2691  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2682 self.assertEqual(re.search(r'12(?!)|3', '123')[0], '3')
2683
2684 def test_character_set_any(self):
2685 # The union of complementary character sets matches any character
2686 # and is equivalent to "(?s:.)".
2687 s = '1x\n'
2688 for p in r'[\s\S]', r'[\d\D]', r'[\w\W]', r'[\S\s]', r'\s|\S':
2689 with self.subTest(pattern=p):
2690 self.assertEqual(re.findall(p, s), list(s))
2691 self.assertEqual(re.fullmatch('(?:' + p + ')+', s).group(), s)
2692
2693 def test_character_set_none(self):
2694 # Negation of the union of complementary character sets does not match

Callers

nothing calls this directly

Calls 6

listClass · 0.85
subTestMethod · 0.80
fullmatchMethod · 0.80
assertEqualMethod · 0.45
findallMethod · 0.45
groupMethod · 0.45

Tested by

no test coverage detected