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

Method test_regression_gh94675

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

Source from the content-addressed store, hash-verified

2660
2661 @unittest.skipIf(multiprocessing is None, 'test requires multiprocessing')
2662 def test_regression_gh94675(self):
2663 pattern = re.compile(r'(?<=[({}])(((//[^\n]*)?[\n])([\000-\040])*)*'
2664 r'((/[^/\[\n]*(([^\n]|(\[\n]*(]*)*\]))'
2665 r'[^/\[]*)*/))((((//[^\n]*)?[\n])'
2666 r'([\000-\040]|(/\*[^*]*\*+'
2667 r'([^/*]\*+)*/))*)+(?=[^\000-\040);\]}]))')
2668 input_js = ''&#x27;a(function() {
2669 ///////////////////////////////////////////////////////////////////
2670 });''&#x27;
2671 p = multiprocessing.Process(target=pattern.sub, args=('', input_js))
2672 p.start()
2673 p.join(SHORT_TIMEOUT)
2674 try:
2675 self.assertFalse(p.is_alive(), 'pattern.sub() timed out')
2676 finally:
2677 if p.is_alive():
2678 p.terminate()
2679 p.join()
2680
2681 def test_fail(self):
2682 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