test_a_qualified_call_site_resolves_instead_of_fanning_out

Tests › tests/test_ast_recovery.py

passed Passed in the packaged run.

What this test is for

Why it exists

#75's resolve half. `Ns::Class::method()` writes the class AT the call site, and `_callee_name_node` peeled it off to match `memberdef.name` — discarding the one piece of evidence that could say WHICH `method`. Measured on the public entropic index: 2,301 of 10,723 member-ish call sites (21%) are qualified.

Given

  1. resolved: list[tuple[int, int, str]] = []
  2. fuzzy: list[tuple[int, int, str]] = []
→

When

  1. _ast_record_call_edge( 1, "poll", {"poll": [10, 11, 12]}, resolved, fuzzy, "ast_member", qualified="net::Socket::poll", definition_of={ 10: "int net::Socket::poll(int)", 11: "int ui::Widget::poll()", 12: "void sched::Loop::poll()", }, )
→

Then

  1. ✓ resolved equals [(1, 10, "ast_member")]
  2. ✓ fuzzy equals []

tests/test_ast_recovery.py:153 · its file's page

What it checks (2)

  1. assert resolved == [(1, 10, "ast_member")], "the qualified match must resolve to ONE" not attributed
  2. assert fuzzy == [], "and must not also fan out" 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_a_qualified_call_site_resolves_instead_of_fanning_out→_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_a_qualified_call_site_resolves_instead_of_fanning_out · 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.