test_search_prose_returns_a_snippet¶
Tests › tests/test_query.py
What this test is for
Why it exists
The sample's markdown is ingested into FTS5; a term known to be in it comes back with a heading and a snippet showing the match in context.
Verifies REQ-DDB-QUERY-002
Given
- —
When
hits = q.search_prose(rich_db, "chime")all(h.snippet for h in hits)
Then
- ✓ hits holds
- ✓ any(h.file_path.endswith(".md") for h in hits) holds
- ✓ all(h.snippet for h in hits) holds
- ✓ any(">>" in h.snippet for h in hits) 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.
clew — `main` (clew/cli.py) · 11 of 400 steps
… 215 earlier steps
… 73 steps between
… 92 later steps
2 more
- `main` (scripts/export_parity.py) · 11 of 203 steps
- Look up one name: everything the index holds about it · 1 of 226 steps
tests/test_query.py:908 · its file's page
What it checks (4)
assert hits, "'chime' is in the fixture tree's docs/architecture.md"observessearch_proseviahitsassert any(h.file_path.endswith(".md") for h in hits)observessearch_proseviahitsassert all(h.snippet for h in hits)observesallassert any(">>" in h.snippet for h in hits), "snippet() must mark the match"observessearch_proseviahits
Where the product reaches it
dossier→_rank_enum_over_mirror→_class_side_is_only_enum_mirrors→all(flow)
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.
Requirements it verifies (1)
| requirement | linked by | implementers exercised |
|---|---|---|
| REQ-DDB-QUERY-002 | catalog | unknown |
Also reaches 4 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-QUERY-001 measured
- REQ-DDB-QUERY-003 measured
- REQ-DDB-QUERY-007 measured
- REQ-DDB-WIKI-054 inferred