test_the_spawn_diagnostic_ignores_non_callable_symbols

Tests › tests/test_thread_spawns.py

passed Passed in the packaged run.

What this test is for

Why it exists

MEASURED ON THREE BUILT INDEXES, not imagined. `detect_undeclared_spawn_primitives` read `SELECT DISTINCT name FROM memberdef` with NO kind filter, so every name in the database was a candidate and only `_spawn_shaped` adjacency stood between a constant and a hint:

Given

  1. conn = sqlite3.connect(":memory:")
  2. conn.execute("CREATE TABLE memberdef (rowid INTEGER PRIMARY KEY, name TEXT, kind TEXT)")
2 more
  1. conn.executemany( "INSERT INTO memberdef (name, kind) VALUES (?, ?)", [ ("sys_thread_create", "function"), ("SYSTEM_TASKCREATE", "macro definition"), ## The real false positive, verbatim from this repository's own index. ("_THREAD_SPAWNER_COLUMNS", "variable"), ("thread_create_fn_t", "typedef"), ("THREAD_CREATE_RESULT", "enumeration"), ], )
  2. conn.commit()
→

When

  1. found = detect_undeclared_spawn_primitives(conn, load_thread_patterns(None))
→

Then

  1. ✓ found equals ["SYSTEM_TASKCREATE", "sys_thread_create"]

tests/test_thread_spawns.py:483 · its file's page

What it checks (1)

  1. assert found == ["SYSTEM_TASKCREATE", "sys_thread_create"], ( f"a spawn primitive is callable — a function or a wrapper macro. Got {found}; a variable, " f"typedef or enumeration that merely NAMES threading is a constant, not a primitive an " f"operator can declare" ) observes detect_undeclared_spawn_primitives via found

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_spawn_diagnostic_ignores_non_callable_symbols→detect_undeclared_spawn_primitives→load_thread_patterns

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.

test_the_spawn_diagnostic_ignores_non_callable_symbols · 1 checksdetect_undeclared_spawn_primitivesREQ-DDB-CONFIG-007 · measuredload_thread_patternsREQ-DDB-SCHEMA-001 · measuredload_thread_patternsdeclaration_originREQ-DDB-SCHEMA-012 · inferred
Also reaches 3 requirements

Its run touches their code; that is reach, not proof.