test_a_clean_target_still_reports_its_zeros¶
Tests › tests/test_diagnostics.py
What this test is for
Why it exists
THE LOAD-BEARING TEST. A silent zero is indistinguishable from a diagnostic that never ran, from an index built before the diagnostic existed, and from a detector that is structurally blind to the target — and this repo has made the third mistake and written it down as a correct negative, on a target whose real accessors were macros with 1,093 call sites and no `kind='function'` rows.
Given
db = _corpus(tmp_path / "clew.db", [("function", "run"), ("function", "main")])
When
meta = dg.collect(db, tmp_path / "absent.Doxyfile", None, None, None).as_meta()
Then
- ✓ meta["accessor_families_count"] equals "0"
- ✓ meta["unclaimed_event_aliases_count"] equals "0"
- ✓ meta["accessor_names_examined"] equals "2"
- ✓ meta["event_vocabulary_source"] equals dg.SOURCE_BUILT_IN
tests/test_diagnostics.py:194 · its file's page
What it checks (4)
assert meta["accessor_families_count"] == "0"observescollectviametaassert meta["unclaimed_event_aliases_count"] == "0"observescollectviametaassert meta["accessor_names_examined"] == "2", "a zero needs the corpus it was measured over"observescollectviametaassert meta["event_vocabulary_source"] == dg.SOURCE_BUILT_INobservescollectviameta
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 7 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-CONFIG-006 measured
- REQ-DDB-CONFIG-007 measured
- REQ-DDB-QUERY-011 measured
- REQ-DDB-SCHEMA-001 measured
- REQ-DDB-SCHEMA-005 measured
- REQ-DDB-SCHEMA-011 measured
- REQ-DDB-SCHEMA-012 measured