test_the_scope_fallback_does_not_disturb_the_definition_match¶
Tests › tests/test_r1_richness.py
What this test is for
Why it exists
THE CONTROL. The fallback must run only when `definition` yielded nothing, or it could overturn a decision the boundary guards already made correctly. Here `definition` names `ns::Owner::run` and a DIFFERENT row carries a scope that would also match — the definition answer has to win.
Verifies REQ-DDB-SCHEMA-001 REQ-DDB-SCHEMA-002 REQ-DDB-SCHEMA-003 REQ-DDB-SCHEMA-004 REQ-DDB-SCHEMA-007
Given
conn = sqlite3.connect(":memory:")conn.executescript( "CREATE TABLE memberdef (rowid INTEGER PRIMARY KEY, kind TEXT, name TEXT, " "definition TEXT, scope TEXT, file_id INTEGER, bodyfile_id INTEGER);" )
2 more
conn.executemany( "INSERT INTO memberdef VALUES (?, 'function', ?, ?, ?, 1, 1)", [ (1, "run", "void ns::Owner::run", ""), (2, "run", " None run", "Owner"), ], )conn.commit()
When
_resolve_qualified_entry(conn, "Owner::run")conn.close()
Then
- ✓ _resolve_qualified_entry(conn, "Owner::run") equals 1
tests/test_r1_richness.py:506 · its file's page
What it checks (1)
assert _resolve_qualified_entry(conn, "Owner::run") == 1, ( "the definition match is decided by the boundary guards and the fallback must not " "overturn it" )observes_resolve_qualified_entry
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_the_scope_fallback_does_not_disturb_the_definition_match→_resolve_qualified_entryWhat 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 (5)
| requirement | linked by | implementers exercised |
|---|---|---|
| REQ-DDB-SCHEMA-001 | catalog | unknown |
| REQ-DDB-SCHEMA-002 | catalog | unknown |
| REQ-DDB-SCHEMA-003 | catalog | unknown |
| REQ-DDB-SCHEMA-004 | catalog | unknown |
| REQ-DDB-SCHEMA-007 | catalog | unknown |