test_body_unchanged_no_violation

Tests › tests/guard/test_guard_checks.py

passed Passed in the packaged run.

What this test is for

Why it exists

The test says nothing about why.

Given

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

When

  1. violations = check_version_staleness( [func], "test.c", CONFIG_DEFAULTS, content, [head_func], 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) · 7 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)optloop (line 458)looploop ×2 (line 459)loop ×2main232. validate_file → parse_content_for_file232parse_content_for_file233. validate_file → check_version_staleness233check_version_staleness234. check_version_staleness → get_validate234get_validate▶ test enters235–237. check_version_staleness → _index_by_identity235_index_by_identity +2 more238–239. _pair_copies → _body_text238_body_text ×2240. _pair_copies → 240… 1 call not run241–243. check_version_staleness → _pair_by_name241_pair_by_name +2 more244. _validate_files → _report_skips244_report_skips245. run_precommit → report_dir245report_dir

… 112 later steps

tests/guard/test_guard_checks.py:127 · 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_body_unchanged_no_violation→_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_body_unchanged_no_violation · 1 checkscheck_version_stalenessREQ-DDB-GUARD-002 · measured
Also reaches 1 requirement

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