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

Method test_unreachable_code

Lib/test/test_patma.py:3502–3513  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

3500
3501 @unittest.expectedFailure # TODO: RUSTPYTHON
3502 def test_unreachable_code(self):
3503 def f(command): # 0
3504 match command: # 1
3505 case 1: # 2
3506 if False: # 3
3507 return 1 # 4
3508 case _: # 5
3509 if False: # 6
3510 return 0 # 7
3511
3512 self.assertListEqual(self._trace(f, 1), [1, 2, 3])
3513 self.assertListEqual(self._trace(f, 0), [1, 2, 5, 6])
3514
3515 def test_parser_deeply_nested_patterns(self):
3516 # Deeply nested patterns can cause exponential backtracking when parsing.

Callers

nothing calls this directly

Calls 2

_traceMethod · 0.95
assertListEqualMethod · 0.80

Tested by

no test coverage detected