test_multiple_functions

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. funcs = [ _make_func(name="Good", def_line=5, body_end=10), _make_func(name="Bad", def_line=15, body_end=20, has_doxygen=False), ]
→

When

  1. violations = check_presence(funcs, "test.c", CONFIG_DEFAULTS)
→

Then

  1. ✓ len(violations) equals 1
  2. ✓ violations[0].message contains "Bad"

What this test is for

Why it exists

The test says nothing about why.

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.

tests/guard/test_guard_checks.py

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

… 173 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.pyother filesother filesother filesother filesopt (line 195)optloop (line 118)loopopt (line 120)optopt (line 268)optopt (line 138)optopt (line 247)optmain174. apply_autobrief → _unmask_escaped_at174_unmask_escaped_at175. validate_file → check_presence175check_presence176. check_presence → get_validate176get_validate▶ test enters177. check_presence → _is_void_function177_is_void_function178. _is_void_function → _is_rust_unit_fn178_is_rust_unit_fn179. check_presence → _suggest_skeleton179_suggest_skeleton180. check_presence → _brief_hint180_brief_hint181. validate_file → check_return_presence181check_return_presence

… 176 later steps

tests/guard/test_guard_ts_parser.py

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

… 113 earlier steps

program launcherprogram launcherprogram launcherprogram launcherclew/guard/config.pyclew/guard/config.pyclew/guard/config.pyclew/guard/config.pyclew/guard/ts_parser.pyclew/guard/ts_parser.pyclew/guard/ts_parser.pyclew/guard/ts_parser.pyother filesother filesother filesother filesloop (line 647)loopopt (line 786)optopt (line 652)optmain114. parse_content_for_file → parse_functions114parse_functions115. parse_functions → parse_functions_ts115parse_functions_ts116. parse_functions_ts → get_parser_for_language116get_parser_for_language▶ test enters117. parse_functions_ts → get_language_spec117get_language_spec118–119. parse_functions_ts → _collect_functions118_collect_functions +1 more120. _is_rust_test_item → _rust_attributes120_rust_attributes121. _collect_functions → _enclosing_class_for121_enclosing_class_for122. _enclosing_class_for → _rust_impl_self_type122_rust_impl_self_type123. _collect_functions → _declared_function123_declared_function124–125. _collect_functions → _append_declaration124_append_declaration +1 more

… 1 step between

program launcherprogram launcherprogram launcherprogram launcherprogram launcherclew/guard/main.pyclew/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/config.pyclew/guard/checks.pyclew/guard/checks.pyclew/guard/checks.pyclew/guard/checks.pyclew/guard/checks.pyclew/guard/ts_parser.pyclew/guard/ts_parser.pyclew/guard/ts_parser.pyclew/guard/ts_parser.pyclew/guard/ts_parser.pyother filesother filesother filesother filesother filesloop (line 647)loopopt (line 377)optalt (line 380)altopt (line 383)optopt (line 384)optopt (line 400)optopt (line 658)optopt (line 681)optopt (line 683)optalt (line 684)altopt (line 227)opttry (line 241)trymain127–128. _append_declaration → _qualified_enclosing127_qualified_enclosing +1 more129–137. _collect_functions → _resolve_function_node129_resolve_function_node +8 more138–140. _find_preceding_doxygen → _collect_rust_doc138_collect_rust_doc +2 more141. _find_preceding_doxygen → _collect_c_comment141_collect_c_comment142. _find_preceding_doxygen → _find_python_docstring_block142_find_python_docstring_block143. _find_preceding_doxygen → parse_doxygen_tags143parse_doxygen_tags144. _find_preceding_doxygen → apply_autobrief144apply_autobrief145. _find_preceding_doxygen → _last_row145_last_row146–149. _collect_functions → _qualified_enclosing146_qualified_enclosing +3 more150. _js_returns_void → _function_carrier150_function_carrier151. _collect_functions → _produced_class151_produced_class152. _produced_class → _function_carrier152_function_carrier153. _collect_functions → _collect_functions153_collect_functions154. _collect_functions → _collect_functions154_collect_functions155. validate_file → unconfigured_language155unconfigured_language156. validate_file → check_file_presence156check_file_presence

… 6 steps between

program launcherprogram launcherprogram launcherprogram launcherclew/guard/checks.pyclew/guard/checks.pyclew/guard/checks.pyclew/guard/checks.pyother filesother filesother filesother filesopt (line 1198)optloop (line 143)loopopt (line 1171)optloop (line 181)loopmain163. _extract_file_block_text → _docstring_block163_docstring_block164. _check_file_block_tags → parse_doxygen_tags164parse_doxygen_tags165–170. parse_doxygen_tags → _mask_escaped_at165_mask_escaped_at +5 more171. _check_file_block_tags → apply_autobrief171apply_autobrief172. apply_autobrief → _mask_escaped_at172_mask_escaped_at

… 185 later steps

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

What it checks (2)

  1. assert len(violations) == 1 observes check_presence via violations
  2. assert "Bad" in violations[0].message observes check_presence via violations

Where the product reaches it

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

Call flow

test_multiple_functions→_make_func→check_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_multiple_functions · 2 checkscheck_presenceREQ-DDB-GUARD-001 · measuredcheck_presence_is_void_functionREQ-DDB-GUARD-005 · inferred

tests/guard/test_guard_ts_parser.py:27 · its file's page

What it checks (3)

  1. assert len(funcs) == 2
  2. assert funcs[0].name == "alpha"
  3. assert funcs[1].name == "beta"

Where the product reaches it

  • main → _run → run_precommit → _validate_files → validate_file → parse_content_for_file → parse_functions → parse_functions_ts (flow)

Call flow

test_multiple_functions→parse_functions_ts

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_multiple_functions · 3 checksparse_functions_ts_collect_functions_find_preceding_doxygenparse_doxygen_tagsREQ-DDB-GUARD-019 · measuredparse_functions_tsREQ-DDB-GUARD-020 · measuredparse_functions_ts_collect_functions_find_preceding_doxygen_find_python_docstring_blockREQ-DDB-GUARD-021 · inferredparse_functions_ts_collect_functions_is_rust_test_itemREQ-DDB-GUARD-024 · inferredparse_functions_ts_collect_functions_js_returns_voidREQ-DDB-GUARD-025 · measured
Also reaches 7 requirements

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