test_c_file_without_file_block_fails

Tests › tests/guard/test_guard_checks_extended.py

passed Passed in the packaged run.

What this test is for

Why it exists

The test says nothing about why.

Given

  1. content = "void func(void) {}\n"
→

When

  1. config = deep_merge(BASE_CONFIG, {"validate": {"presence": {"require_file_doxygen": True}}})
  2. violations = check_file_presence("a.c", content, config)
→

Then

  1. ✓ len(violations) equals 1

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) · 5 of 357 steps

… 42 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.pyloop (line 651)loopopt (line 653)optopt (line 733)optmain43–44. load_config → apply_opt_in_languages43apply_opt_in_languages +1 more45. deep_merge → deep_merge45deep_merge46. load_config → deep_merge46deep_merge47. _run → run_precommit47run_precommit

… 107 steps between

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 227)opttry (line 241)trymain155. validate_file → unconfigured_language155unconfigured_language156. validate_file → check_file_presence156check_file_presence157. check_file_presence → get_validate157get_validate▶ test enters158–160. check_file_presence → _find_file_doxygen_start158_find_file_doxygen_start +2 more161–162. check_file_presence → _check_file_block_tags161_check_file_block_tags +1 more

… 195 later steps

tests/guard/test_guard_checks_extended.py:128 · its file's page

What it checks (1)

  1. assert len(violations) == 1 observes check_file_presence via violations

Where the product reaches it

  • main → _run → run_precommit → _validate_files → validate_file → check_file_presence (flow)
  • main → _run → load_config → deep_merge (flow)

Call flow

test_c_file_without_file_block_fails→deep_merge→check_file_presence

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_c_file_without_file_block_fails · 1 checkscheck_file_presenceREQ-DDB-GUARD-006 · measuredcheck_file_presence_check_file_block_tagsparse_doxygen_tagsREQ-DDB-GUARD-019 · inferredcheck_file_presence_check_file_block_tagsapply_autobriefREQ-DDB-GUARD-024 · inferred
Also reaches 3 requirements

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