test_a_make_unique_site_names_the_constructed_class¶
Tests › tests/test_ast_recovery.py
What this test is for
Why it exists
gh#15. `std::make_unique<FilesystemServer>(...)` unwrapped to `make_unique`, which no index holds, so the sole PRODUCTION construction of a server emitted no edge and `dossier("FilesystemServer")` listed only a test helper that calls the constructor directly. The reporter followed that helper, hit a dead end, and shipped a design document recommending the wrong configuration.
Given
parsed = _parse(tmp_path, "w.cpp", _CONSTRUCTION)tree, src = parsed
When
by_name = {site[0]: site for site in _ast_harvest_calls(tree, src)}
Then
- ✓ parsed is not None
- ✓ by_name does not contain "make_unique"
- ✓ by_name does not contain "make_shared"
- ✓ by_name contains "FilesystemServer"
- ✓ by_name contains "BashServer"
- ✓ by_name["BashServer"][3] equals "entropic::BashServer"
- ✓ by_name["FilesystemServer"][3] equals "FilesystemServer"
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) · 7 of 400 steps
… 70 earlier steps
… 313 later steps
tests/test_ast_recovery.py:318 · its file's page
What it checks (7)
assert parsed is not Nonenot attributedassert "make_unique" not in by_name, "the factory template is not the callee — the class is"observes_ast_harvest_callsviaby_nameassert "make_shared" not in by_nameobserves_ast_harvest_callsviaby_nameassert "FilesystemServer" in by_name, f"got {sorted(by_name)}"observes_ast_harvest_callsviaby_nameassert "BashServer" in by_name, f"got {sorted(by_name)}"observes_ast_harvest_callsviaby_nameassert by_name["BashServer"][3] == "entropic::BashServer"observes_ast_harvest_callsviaby_nameassert by_name["FilesystemServer"][3] == "FilesystemServer"observes_ast_harvest_callsviaby_name
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_make_unique_site_names_the_constructed_class→_ast_harvest_callsWhat 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 2 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-PIPE-003 measured
- REQ-DDB-PIPE-011 measured