test_recovery_is_idempotent_for_macros¶
Tests › tests/test_macro_recovery.py
What this test is for
Why it exists
A `(file, name, line)` key is finer than the variable rule's `(file, name)`, and a finer key has more ways to miss: read back the wrong column, or compare a tree-sitter line against a `bodystart`, and every macro is re-inserted on every build. Only a second pass returning zero new rows catches it.
Given
- —
When
recover_ast_symbols(taken_branch_index, repo, None)after_first = _macro_rows(taken_branch_index, SYMBOL_SOURCE_AST)recover_ast_symbols(taken_branch_index, repo, None)
Then
- ✓ _macro_rows(taken_branch_index, SYMBOL_SOURCE_AST) equals after_first
- ✓ _macro_rows(taken_branch_index, SYMBOL_SOURCE_DOXYGEN) equals 1
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_macro_recovery.py:271 · its file's page
What it checks (2)
assert _macro_rows(taken_branch_index, SYMBOL_SOURCE_AST) == after_firstobserves_macro_rowsassert _macro_rows(taken_branch_index, SYMBOL_SOURCE_DOXYGEN) == 1observes_macro_rows
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
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 5 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-INDEX-004 measured
- REQ-DDB-PIPE-003 measured
- REQ-DDB-PIPE-011 measured
- REQ-DDB-PIPE-012 inferred
- REQ-DDB-WIKI-054 inferred