test_resolve_qualified_entry_rejects_suffix_collision

Tests › tests/test_r1_richness.py

passed Passed in the packaged run.

What this test is for

Why it exists

`Owner::run` must NOT resolve to `CoOwner::run` — a bare `%Class::method` LIKE matches any class whose NAME ends with `Class`, so the resolver anchors the match to a token boundary. Guards a silent mis-attribution of a thread's entry (and thus its whole membership closure) to the wrong class.

Verifies REQ-DDB-SCHEMA-001 REQ-DDB-SCHEMA-002 REQ-DDB-SCHEMA-003 REQ-DDB-SCHEMA-004 REQ-DDB-SCHEMA-007

Given

  1. conn = sqlite3.connect(":memory:")
  2. conn.executescript( "CREATE TABLE memberdef (rowid INTEGER PRIMARY KEY, kind TEXT, name TEXT, " "definition TEXT, file_id INTEGER, bodyfile_id INTEGER);", )
2 more
  1. conn.execute( "INSERT INTO memberdef VALUES (1, 'function', 'run', 'void ns::CoOwner::run', 1, 1)" )
  2. conn.commit()
→

When

  1. _resolve_qualified_entry(conn, "Owner::run")
  2. conn.execute("INSERT INTO memberdef VALUES (2, 'function', 'run', 'void ns::Owner::run', 1, 1)")
  3. conn.commit()
  4. conn.close()
→

Then

  1. ✓ _resolve_qualified_entry(conn, "Owner::run") is None
  2. ✓ _resolve_qualified_entry(conn, "Owner::run") equals 2

tests/test_r1_richness.py:409 · its file's page

What it checks (2)

  1. assert _resolve_qualified_entry(conn, "Owner::run") is None observes _resolve_qualified_entry
  2. assert _resolve_qualified_entry(conn, "Owner::run") == 2 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_resolve_qualified_entry_rejects_suffix_collision→_resolve_qualified_entry

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 (5)

requirementlinked byimplementers exercised
REQ-DDB-SCHEMA-001catalogunknown
REQ-DDB-SCHEMA-002catalogunknown
REQ-DDB-SCHEMA-003catalogunknown
REQ-DDB-SCHEMA-004catalogunknown
REQ-DDB-SCHEMA-007catalogunknown