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

Method test_default_wildcard

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

Source from the content-addressed store, hash-verified

3427 return actual_linenos
3428
3429 def test_default_wildcard(self):
3430 def f(command): # 0
3431 match command.split(): # 1
3432 case ["go", direction] if direction in "nesw": # 2
3433 return f"go {direction}" # 3
3434 case ["go", _]: # 4
3435 return "no go" # 5
3436 case _: # 6
3437 return "default" # 7
3438
3439 self.assertListEqual(self._trace(f, "go n"), [1, 2, 3])
3440 self.assertListEqual(self._trace(f, "go x"), [1, 2, 4, 5])
3441 self.assertListEqual(self._trace(f, "spam"), [1, 2, 4, 6, 7])
3442
3443 def test_default_capture(self):
3444 def f(command): # 0

Callers

nothing calls this directly

Calls 2

_traceMethod · 0.95
assertListEqualMethod · 0.80

Tested by

no test coverage detected