test_a_bare_call_reaches_a_RECOVERED_definition

Tests › tests/test_bare_call_one_function.py

passed Passed in the packaged run.

What this test is for

Why it exists

THE REPORTED SHAPE. doxygen saw the prototype and not the definition, so the only definition row is the one `recover_ast_symbols` wrote, spelled the way the source spells it. The call is to the one function both rows describe, and it must land on the row with the body.

Given

  1. repo, db = _build(tmp_path, _GUARDED_SOURCE, [_PROTOTYPE, _USE_IT])
→

When

  1. recover_ast_symbols(db, repo)
  2. build_call_edges(db)
  3. import_ast_call_edges(db, repo)
3 more
  1. conn = sqlite3.connect(str(db))
  2. recovered = conn.execute( "SELECT rowid FROM memberdef WHERE name = 'lib_fn' AND dg_source = 'ast'" ).fetchone()[0]
  3. conn.close()
→

Then

  1. ✓ recover_ast_symbols(db, repo) is at least 1
  2. ✓ _edges_to(db, "lib_fn") equals [("use_it", recovered, SOURCE_AST)]

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.

clew — `main` (clew/cli.py) · 10 of 400 steps

… 70 earlier steps

command-line usercommand-line usercommand-line usercommand-line userclew/propose/astdefs.pyclew/propose/astdefs.pyclew/propose/astdefs.pyclew/propose/astdefs.pyother filesother filesother filesother filesloop (line 134)looploop (line 135)looploop (line 239)looploop (line 268)loopopt (line 270)optmain71–72. repo_source_files → _scandir71_scandir +1 more73. _ts_language_for → _grammar_available73_grammar_available74–75. _grammar_available → has_language74has_language +1 more76. _ts_language_for → _try_import_ts_module76_try_import_ts_module77–80. build_context → scope_membership77scope_membership +3 more81. _ast_parse_one_file → _ts_language_for81_ts_language_for▶ test enters82–88. _ast_parse_one_file → _cached_parser82_cached_parser +6 more89. scan_repo → _absorb_file89_absorb_file90. _absorb_file → definition_record90definition_record

… 310 later steps

tests/test_bare_call_one_function.py:148 · its file's page

What it checks (2)

  1. assert recover_ast_symbols(db, repo) >= 1, "premise: the guarded definition is recovered" observes recover_ast_symbols
  2. assert _edges_to(db, "lib_fn") == [("use_it", recovered, SOURCE_AST)] observes _edges_to

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

test_a_bare_call_reaches_a_RECOVERED_definition→_build→recover_ast_symbols→build_call_edges→import_ast_call_edges→_edges_to

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_bare_call_reaches_a_RECOVERED_definition · 2 checksrecover_ast_symbolsREQ-DDB-INDEX-004 · measuredbuild_call_edgesREQ-DDB-PIPE-003 · measuredimport_ast_call_edgesrun_harvest_harvest_one_file_parseable_fileREQ-DDB-PIPE-011 · measuredimport_ast_call_edges… 4 calls …has_languageREQ-DDB-PIPE-012 · inferredrecover_ast_symbols_recover_intoallREQ-DDB-WIKI-054 · inferred
Also reaches 6 requirements

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