test_candidates_keeps_two_real_overloads_apart¶
Tests › tests/test_disambiguation.py
What this test is for
Why it exists
THE CONTROL, and the reason the key includes `line`. Two overloads of one class share a doxygen `definition` string exactly — the parameter list lives in `argsstring`, which this tuple does not carry — so a signature-keyed dedupe would silently collapse them and report one identity where the caller genuinely has to choose between two.
Given
conn = sqlite3.connect(":memory:")conn.executescript("CREATE TABLE memberdef (rowid INTEGER PRIMARY KEY, name TEXT, kind TEXT);")overloads = [ (10, "void C::f", "include/c.h", 10, True), (11, "void C::f", "include/c.h", 11, True), ]
When
candidate_rows(conn, "f", overloads)across_files = [ (10, "void C::f", "a/c.h", 10, True), (11, "void C::f", "b/c.h", 10, True), ]candidate_rows(conn, "f", across_files)
Then
- ✓ len(candidate_rows(conn, "f", overloads)) equals 2
- ✓ len(candidate_rows(conn, "f", across_files)) equals 2
What it exercises
The parts of the system's flows this test ran, measured by per-test coverage: lit steps ran in this test, dimmed ones did not, and ▶ marks where the test called in. Each title opens the whole flow with these steps lit.
Look up one name: everything the index holds about it · 6 of 226 steps
… 17 earlier steps
… 55 steps between
… 105 steps between
… 31 later steps
2 more
- clew — `main` (clew/cli.py) · 3 of 400 steps
- `main` (scripts/export_parity.py) · 3 of 203 steps
tests/test_disambiguation.py:410 · its file's page
What it checks (2)
assert len(candidate_rows(conn, "f", overloads)) == 2, "two overloads are two identities"observescandidate_rowsassert len(candidate_rows(conn, "f", across_files)) == 2observescandidate_rows
Where the product reaches it
dossier→_chain_for→chain_trace→candidate_rows(flow)
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 3 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-INDEX-004 measured
- REQ-DDB-QUERY-003 measured
- REQ-DDB-QUERY-010 measured