test_thread_spawn_resolves_closure_entry

Tests › tests/test_rust_ast.py

passed Passed in the packaged run.

What this test is for

Why it exists

The test says nothing about why.

Given

  1. tree, src = _parse( "fn worker() {}\nfn main() {\n std::thread::spawn(|| { worker(); });\n}\n" )
→

When

  1. patterns = patterns_by_name(load_thread_patterns(None))
  2. sites = _walk_spawn_sites(tree, src, patterns)
  3. thread_name, entry_name, kind, qualified_entry, _sep, line, spawn_fn, _source = sites[0][:8]
→

Then

  1. ✓ len(sites) equals 1
  2. ✓ len(sites[0]) equals 10
  3. ✓ entry_name equals "worker"
  4. ✓ kind equals "pthread"
  5. ✓ spawn_fn equals "main"
  6. ✓ line equals 3

tests/test_rust_ast.py:72 · its file's page

What it checks (6)

  1. assert len(sites) == 1 observes _walk_spawn_sites via sites
  2. assert len(sites[0]) == 10 observes _walk_spawn_sites via sites
  3. assert entry_name == "worker" not attributed
  4. assert kind == "pthread" not attributed
  5. assert spawn_fn == "main" not attributed
  6. assert line == 3 not 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_sites

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_thread_spawn_resolves_closure_entry · 6 checks_walk_spawn_sitesis_python_treeREQ-DDB-PIPE-003 · 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.