test_a_candidate_without_a_line_is_left_alone

Tests › tests/test_disambiguation.py

passed Passed in the packaged run.

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

  1. conn = sqlite3.connect(":memory:")
  2. conn.executescript("CREATE TABLE memberdef (rowid INTEGER PRIMARY KEY, name TEXT, kind TEXT);")
  3. unpositioned = [ (10, "void C::f", "include/c.h", None, False), (11, "void C::f", "include/c.h", None, False), ]
→

When

  1. candidate_rows(conn, "f", unpositioned)
→

Then

  1. ✓ 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

callercallercallercallerclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/recovery.pyclew/query/recovery.pyclew/query/recovery.pyclew/query/recovery.pydossier18. _documentation_mentions → table_exists18table_exists19. _documentation_mentions → has_columns19has_columns20. has_columns → table_exists20table_exists21–22. _hint_from → _name_exists21_name_exists +1 more

… 55 steps between

callercallercallercallerclew/query/payload.pyclew/query/payload.pyclew/query/payload.pyclew/query/payload.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyother filesother filesother filesother filesdossier78. _referenced_by → table_exists78table_exists79. _macro_def → symbol_provenance79symbol_provenance80–81. symbol_provenance → records_provenance80records_provenance +1 more82. _gate_definitions → _gate_definition_gaps82_gate_definition_gaps83. _flatten_subject → _empty_callers_note83_empty_callers_note

… 105 steps between

callercallercallercallerclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/traversal.pyclew/query/traversal.pyclew/query/traversal.pyclew/query/traversal.pydossier189. chain_trace → function_candidates189function_candidates190. chain_trace → candidate_rows190candidate_rows191. candidate_rows → symbol_provenance191symbol_provenance▶ test enters192–193. candidate_rows → qualified_name_of192qualified_name_of +1 more194. chain_trace → is_overloaded194is_overloaded195. chain_trace → _make_node195_make_node

… 31 later steps

2 more

tests/test_disambiguation.py:443 · its file's page

What it checks (1)

  1. assert len(candidate_rows(conn, "f", unpositioned)) == 2 observes candidate_rows

Where the product reaches it

  • dossier → _chain_for → chain_trace → candidate_rows (flow)

Call flow

test_a_candidate_without_a_line_is_left_alone→candidate_rows

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_candidate_without_a_line_is_left_alone · 1 checkscandidate_rowssymbol_provenanceREQ-DDB-INDEX-004 · measuredcandidate_rowsREQ-DDB-QUERY-003 · measuredcandidate_rowsREQ-DDB-QUERY-010 · measured
Also reaches 3 requirements

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