test_virtual_override_of_the_anchor_is_kept¶
Tests › tests/test_dominated_edges.py
What this test is for
Why it exists
Template-method dispatch: a base `generate()` calls the protected virtual `do_generate()`, and the real dynamic target is the derived override. The fan-out row is the ONLY edge that reaches it, so deleting it would remove genuine dispatch reach — 48 rows of exactly this shape on entropic.
Given
conn = _index( [ (20, "generate", "Result Backend::generate"), (21, "do_generate", "Result Backend::do_generate"), (22, "do_generate", "Result LlamaBackend::do_generate"), (23, "do_generate", "Result UnrelatedThing::do_generate"), ], [ (20, 21, CALL_SOURCE_DOXYGEN_SQLITE, CALL_MATCH_EXACT), (20, 22, CALL_SOURCE_AST, CALL_MATCH_FUZZY), (20, 23, CALL_SOURCE_AST, CALL_MATCH_FUZZY), ], reimplements=[(22, 21)], )
When
prune_dominated_fuzzy_edges(conn)survivors = _rows(conn)
Then
- ✓ prune_dominated_fuzzy_edges(conn) equals 1
- ✓ survivors contains (20, 22, CALL_SOURCE_AST)
- ✓ survivors does not contain (20, 23, CALL_SOURCE_AST)
tests/test_dominated_edges.py:227 · its file's page
What it checks (3)
assert prune_dominated_fuzzy_edges(conn) == 1observesprune_dominated_fuzzy_edgesassert (20, 22, CALL_SOURCE_AST) in survivors, "virtual override lost its only edge"observes_rowsviasurvivorsassert (20, 23, CALL_SOURCE_AST) not in survivorsobserves_rowsviasurvivors
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
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.
Also reaches 2 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-PIPE-009 measured
- REQ-DDB-QUERY-003 measured