test_genuine_recursion_survives_the_identity_split¶
Tests › tests/test_query.py
What this test is for
Why it exists
The control for the test above, and the reason it cannot simply drop every self-edge on an ambiguous name: `scope._classify` really does recurse. A fix that suppressed self-edges whenever `candidates` was non-empty would pass the gh#26 test and DELETE a true fact, so the split must be by identity rather than by ambiguity.
Verifies REQ-DDB-QUERY-002
Given
db = tmp_path / "collide.db"_name_collision_db(db)
When
scope_callers = q.callers(db, "_classify")from clew.query._common import connect, identity_rowidswith connect(db) as conn: assert identity_rowids(conn, "_classify") == [1], "bare name resolves to ONE identity" rows = conn.execute( "SELECT caller_rowid, callee_rowid FROM call_edges WHERE caller_rowid = callee_rowid" ).fetchall()
Then
- ✓ {c.name for c in scope_callers} does not contain "_guard_scope"
- ✓ rows equals [(3, 3)]
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.
Look up one name: everything the index holds about it · 10 of 226 steps
… 17 earlier steps
… 23 steps between
… 81 steps between
… 37 steps between
… 15 steps between
… 21 later steps
3 more
- Build this wiki from the index · 7 of 400 steps
- clew — `main` (clew/cli.py) · 1 of 400 steps
- `main` (scripts/export_parity.py) · 1 of 203 steps
tests/test_query.py:1681 · its file's page
What it checks (3)
assert "_guard_scope" not in {c.name for c in scope_callers}observescallersviascope_callersassert identity_rowids(conn, "_classify") == [1], "bare name resolves to ONE identity"observesidentity_rowidsassert rows == [(3, 3)], "scope._classify's recursion is untouched in the db"not attributed
Where the product reaches it
Call flow
test_genuine_recursion_survives_the_identity_split→_name_collision_db→callers→connect→identity_rowidsWhat 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-009 measured
- REQ-DDB-QUERY-010 measured