test_unnamed_spawns_get_distinct_names

Tests › tests/test_lambda_thread_spawns.py

passed Passed in the packaged run.

What this test is for

Why it exists

**THE FIX THAT LOOKS LIKE IT WORKED AND UNDERCOUNTS BY THREE.** `threads` is UNIQUE(name, entry_memberdef_rowid, kind). With a NULL entry, four lambdas sharing one placeholder name collapse into a single row, so the harvester would report 2 threads where the source has 5 — and every count downstream would be wrong while the bug report said fixed.

Given

  1. —
→

When

  1. patterns = patterns_by_name(load_thread_patterns(None))
  2. tree, src = _parse(_LAMBDA_FORMS)
  3. names = [s[0] for s in _walk_spawn_sites(tree, src, patterns)]
→

Then

  1. ✓ len(set(names)) equals len(names)

What it exercises

The parts of the system's flows this test ran, measured by per-test coverage: lit steps ran in this test, dimmed ones did not, and ▶ marks where the test called in. Each title opens the whole flow with these steps lit.

clew — `main` (clew/cli.py) · 1 of 400 steps

… 80 earlier steps

command-line usercommand-line usercommand-line usercommand-line userother filesother filesother filesother filesopt (line 288)optmain81–82. _ast_parse_one_file → _ts_language_for81_ts_language_for +1 more83. _cached_parser → _try_import_ts_module83_try_import_ts_module▶ test enters84–85. _ast_parse_one_file → _parseable_file84_parseable_file +1 more

… 315 later steps

tests/test_lambda_thread_spawns.py:151 · its file's page

What it checks (1)

  1. assert len(set(names)) == len(names), f"spawn names collide and would collapse rows: {names}" observes _walk_spawn_sites via names

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_unnamed_spawns_get_distinct_names→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_unnamed_spawns_get_distinct_names · 1 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.