MCPcopy Index your code
hub / github.com/python/cpython / test_regression_gh94675

Method test_regression_gh94675

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

Source from the content-addressed store, hash-verified

2678
2679 @unittest.skipIf(multiprocessing is None, 'test requires multiprocessing')
2680 def test_regression_gh94675(self):
2681 pattern = re.compile(r'(?<=[({}])(((//[^\n]*)?[\n])([\000-\040])*)*'
2682 r'((/[^/\[\n]*(([^\n]|(\[\n]*(]*)*\]))'
2683 r'[^/\[]*)*/))((((//[^\n]*)?[\n])'
2684 r'([\000-\040]|(/\*[^*]*\*+'
2685 r'([^/*]\*+)*/))*)+(?=[^\000-\040);\]}]))')
2686 input_js = ''&#x27;a(function() {
2687 ///////////////////////////////////////////////////////////////////
2688 });''&#x27;
2689 p = multiprocessing.Process(target=pattern.sub, args=('', input_js))
2690 p.start()
2691 p.join(SHORT_TIMEOUT)
2692 try:
2693 self.assertFalse(p.is_alive(), 'pattern.sub() timed out')
2694 finally:
2695 if p.is_alive():
2696 p.terminate()
2697 p.join()
2698
2699 def test_fail(self):
2700 self.assertEqual(re.search(r'12(?!)|3', '123')[0], '3')

Callers

nothing calls this directly

Calls 7

terminateMethod · 0.95
assertFalseMethod · 0.80
compileMethod · 0.45
ProcessMethod · 0.45
startMethod · 0.45
joinMethod · 0.45
is_aliveMethod · 0.45

Tested by

no test coverage detected