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

Method test_re_benchmarks

Lib/test/test_re.py:3053–3066  ·  view source on GitHub ↗

re_tests benchmarks

(self)

Source from the content-addressed store, hash-verified

3051class ExternalTests(unittest.TestCase):
3052
3053 def test_re_benchmarks(self):
3054 're_tests benchmarks'
3055 from test.re_tests import benchmarks
3056 for pattern, s in benchmarks:
3057 with self.subTest(pattern=pattern, string=s):
3058 p = re.compile(pattern)
3059 self.assertTrue(p.search(s))
3060 self.assertTrue(p.match(s))
3061 self.assertTrue(p.fullmatch(s))
3062 s2 = ' '*10000 + s + ' '*10000
3063 self.assertTrue(p.search(s2))
3064 self.assertTrue(p.match(s2, 10000))
3065 self.assertTrue(p.match(s2, 10000, 10000 + len(s)))
3066 self.assertTrue(p.fullmatch(s2, 10000, 10000 + len(s)))
3067
3068 def test_re_tests(self):
3069 're_tests test suite'

Callers

nothing calls this directly

Calls 7

lenFunction · 0.85
subTestMethod · 0.80
assertTrueMethod · 0.80
fullmatchMethod · 0.80
compileMethod · 0.45
searchMethod · 0.45
matchMethod · 0.45

Tested by

no test coverage detected