test_new_function_same_name_different_body_shape_still_new

Tests › tests/guard/test_guard_checks.py

passed Passed in the packaged run.

What this test is for

Why it exists

Regression for issue #10: a new function whose @version line is textually identical to HEAD's must not be flagged, even though its enclosing content differs in ways that could confuse a positional diff.

Given

  1. func = _make_func(name="add_grid_source_params", def_line=5, body_end=6)
  2. content = "\n".join(_lines_for(func, "int a;\nint b;"))
→

When

  1. violations = check_version_staleness( [func], "test.c", CONFIG_DEFAULTS, content, head_functions=[], head_content="" )
→

Then

  1. ✓ violations equals []

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.

`main` (clew/guard/main.py) · 8 of 357 steps

… 231 earlier steps

program launcherprogram launcherprogram launcherprogram launcherclew/guard/main.pyclew/guard/main.pyclew/guard/main.pyclew/guard/main.pyclew/guard/config.pyclew/guard/config.pyclew/guard/config.pyclew/guard/config.pyclew/guard/checks.pyclew/guard/checks.pyclew/guard/checks.pyclew/guard/checks.pyopt (line 265)optmain232. validate_file → parse_content_for_file232parse_content_for_file233. validate_file → check_version_staleness233check_version_staleness234. check_version_staleness → get_validate234get_validate▶ test enters235–239. check_version_staleness → _index_by_identity235_index_by_identity +4 more240. _pair_copies → 240… 1 call not run241–242. check_version_staleness → _pair_by_name241_pair_by_name +1 more243. _check_one_version → _body_text243_body_text244. _validate_files → _report_skips244_report_skips

… 113 later steps

tests/guard/test_guard_checks.py:252 · its file's page

What it checks (1)

  1. assert violations == [] observes check_version_staleness via violations

Where the product reaches it

  • main → _run → run_precommit → _validate_files → validate_file → check_version_staleness (flow)

Call flow

test_new_function_same_name_different_body_shape_still_new→_make_func→_lines_for→check_version_staleness

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_new_function_same_name_different_body_shape_still_new · 1 checkscheck_version_stalenessREQ-DDB-GUARD-002 · measured
Also reaches 1 requirement

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