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

Method test_ignore_spaces

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

Source from the content-addressed store, hash-verified

1962 self.checkPatternError(r'(?iz', 'unknown flag', 3)
1963
1964 def test_ignore_spaces(self):
1965 for space in " \t\n\r\v\f":
1966 self.assertTrue(re.fullmatch(space + 'a', 'a', re.VERBOSE))
1967 for space in b" ", b"\t", b"\n", b"\r", b"\v", b"\f":
1968 self.assertTrue(re.fullmatch(space + b'a', b'a', re.VERBOSE))
1969 self.assertTrue(re.fullmatch('(?x) a', 'a'))
1970 self.assertTrue(re.fullmatch(' (?x) a', 'a', re.VERBOSE))
1971 self.assertTrue(re.fullmatch('(?x) (?x) a', 'a'))
1972 self.assertTrue(re.fullmatch(' a(?x: b) c', ' ab c'))
1973 self.assertTrue(re.fullmatch(' a(?-x: b) c', 'a bc', re.VERBOSE))
1974 self.assertTrue(re.fullmatch('(?x) a(?-x: b) c', 'a bc'))
1975 self.assertTrue(re.fullmatch('(?x) a| b', 'a'))
1976 self.assertTrue(re.fullmatch('(?x) a| b', 'b'))
1977
1978 def test_comments(self):
1979 self.assertTrue(re.fullmatch('#x\na', 'a', re.VERBOSE))

Callers

nothing calls this directly

Calls 2

assertTrueMethod · 0.80
fullmatchMethod · 0.80

Tested by

no test coverage detected