test_thread_spawn_resolves_closure_entry¶
Tests › tests/test_rust_ast.py
What this test is for
Why it exists
The test says nothing about why.
Given
tree, src = _parse( "fn worker() {}\nfn main() {\n std::thread::spawn(|| { worker(); });\n}\n" )
When
patterns = patterns_by_name(load_thread_patterns(None))sites = _walk_spawn_sites(tree, src, patterns)thread_name, entry_name, kind, qualified_entry, _sep, line, spawn_fn, _source = sites[0][:8]
Then
- ✓ len(sites) equals 1
- ✓ len(sites[0]) equals 10
- ✓ entry_name equals "worker"
- ✓ kind equals "pthread"
- ✓ spawn_fn equals "main"
- ✓ line equals 3
tests/test_rust_ast.py:72 · its file's page
What it checks (6)
assert len(sites) == 1observes_walk_spawn_sitesviasitesassert len(sites[0]) == 10observes_walk_spawn_sitesviasitesassert entry_name == "worker"not attributedassert kind == "pthread"not attributedassert spawn_fn == "main"not attributedassert line == 3not attributed
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_thread_spawn_resolves_closure_entry→_parse→patterns_by_name→load_thread_patterns→_walk_spawn_sitesWhat 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.
Also reaches 3 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-PIPE-003 measured
- REQ-DDB-SCHEMA-001 measured
- REQ-DDB-SCHEMA-012 inferred