test_an_ambiguous_call_without_a_selector_behaves_as_before

Tests › tests/test_disambiguation.py

passed Passed in the packaged run.

What this test is for

Why it exists

The control on the whole change. `qualified` must be OPTIONAL and omitting it must reproduce the previous behaviour exactly — the definition-preferring first row, with the alternatives listed in `candidates`. Without this assertion the change could be a breaking one and every other test here would still pass.

Given

  1. —
→

When

  1. ref = q.resolve_symbol(shared_name_db, "harvest")
  2. all(c.qualified for c in ref.candidates)
→

Then

  1. ✓ ref is not None
  2. ✓ ref.rowid equals OVERRIDE_A
  3. ✓ {c.qualified for c in ref.candidates} equals {BASE_QUALIFIED, A_QUALIFIED, B_QUALIFIED}
  4. ✓ all(c.qualified for c in ref.candidates) holds

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 · 10 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

… 23 steps between

callercallercallercallerclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyother filesother filesother filesother filesdossier46. _ambiguity_counts → table_exists46table_exists47. _ambiguity_counts → function_candidates47function_candidates48. function_candidates → table_exists48table_exists▶ test enters49–51. function_candidates → _test_scope_term49_test_scope_term +2 more52–53. matching_identity → qualified_name_of52qualified_name_of +1 more

… 24 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

3 more

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

What it checks (4)

  1. assert ref is not None observes resolve_symbol via ref
  2. assert ref.rowid == OVERRIDE_A, "the definition-preferring pick must not have moved" observes resolve_symbol via ref
  3. assert {c.qualified for c in ref.candidates} == {BASE_QUALIFIED, A_QUALIFIED, B_QUALIFIED} observes resolve_symbol via ref
  4. assert all(c.qualified for c in ref.candidates) observes all

Where the product reaches it

  • dossier → _rank_enum_over_mirror → _class_side_is_only_enum_mirrors → all (flow)

Call flow

test_an_ambiguous_call_without_a_selector_behaves_as_before→resolve_symbol→all

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_an_ambiguous_call_without_a_selector_behaves_as_before · 4 checksresolve_symbolsymbol_provenanceREQ-DDB-INDEX-004 · measuredresolve_symbolconnectREQ-DDB-QUERY-001 · measuredresolve_symbolREQ-DDB-QUERY-003 · measuredresolve_symbolREQ-DDB-QUERY-010 · measuredallREQ-DDB-WIKI-054 · inferred
Also reaches 5 requirements

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