test_two_bodies_with_one_signature_are_still_refused

Tests › tests/test_bare_call_one_function.py

passed Passed in the packaged run.

What this test is for

Why it exists

THE CONTROL on the resolution. Two `static int helper(void)` definitions in two files share an identity and are still two functions; a name cannot say which one a call meant, so the call is refused exactly as before (gh#347) and the refusal is recorded.

Given

  1. identity = ("helper", "helper", "(void)")
→

When

  1. targets = _one_function_targets( {"helper": [30, 31]}, {30: identity, 31: identity}, {30: (1, 10), 31: (2, 10)}, homes={30, 31}, )
  2. resolved: list[tuple[int, int, str]] = []
  3. unresolved: list[list[int]] = []
  4. _ast_record_call_edge( 1, "helper", {"helper": [30, 31]}, resolved, [], SOURCE_AST, unresolved=unresolved, one_function=targets, )
→

Then

  1. ✓ targets equals {}
  2. ✓ resolved equals []
  3. ✓ unresolved equals [[30, 31]]

tests/test_bare_call_one_function.py:224 · its file's page

What it checks (2)

  1. assert targets == {}, "two bodies are two functions" observes _one_function_targets via targets
  2. assert resolved == [] and unresolved == [[30, 31]] not attributed

Where the product reaches it

No product flow reaches this code: no product entry point's flow calls any of the functions this test calls.

Call flow

test_two_bodies_with_one_signature_are_still_refused→_one_function_targets→_ast_record_call_edge

What it reaches

Each row runs from this test, through the calls it makes, to the code a requirement names. If that code breaks, the test's checks are what should catch it. Reaching is not proving: a check only proves what it observes. No mutation records were given, so these rows say what the test REACHES.

test_two_bodies_with_one_signature_are_still_refused · 2 checks_ast_record_call_edge_narrow_by_receiver_one_classallREQ-DDB-WIKI-054 · inferred
Also reaches 1 requirement

Its run touches their code; that is reach, not proof.