test_a_candidate_without_a_line_is_left_alone¶
Tests › tests/test_disambiguation.py
What this test is for
Why it exists
FAILS OPEN. A row whose `line` is NULL carries no position, so two such rows cannot be SHOWN to be the same declaration — only to be indistinguishable in this tuple. Merging them would be a guess in the direction that loses information, and the pre-gh#19 behaviour (report both) is the safe one.
Given
conn = sqlite3.connect(":memory:")conn.executescript("CREATE TABLE memberdef (rowid INTEGER PRIMARY KEY, name TEXT, kind TEXT);")unpositioned = [ (10, "void C::f", "include/c.h", None, False), (11, "void C::f", "include/c.h", None, False), ]
When
candidate_rows(conn, "f", unpositioned)
Then
- ✓ len(candidate_rows(conn, "f", unpositioned)) 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:443 · its file's page
What it checks (1)
assert len(candidate_rows(conn, "f", unpositioned)) == 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