test_a_hash_comment_block_above_the_function_is_its_doc¶
Tests › tests/test_shast.py
What this test is for
Why it exists
Shell has no doxygen comment, so the convention IS the `#` block immediately above, and the tags inside it are kept as literal text the way doxygen keeps an unknown tag.
Given
out = _harvest(_SCRIPT)deploy = next(fn for fn in out["functions"] if fn["name"] == "deploy")rollback = next(fn for fn in out["functions"] if fn["name"] == "rollback")
When
- —
Then
- ✓ deploy["doc"] contains "Deploy the built artefact to one target."
- ✓ deploy["doc"] contains "@version 3"
- ✓ deploy["doc"] does not contain "#"
- ✓ rollback["doc"] contains "Undo the last deploy."
tests/test_shast.py:83 · its file's page
What it checks (4)
assert "Deploy the built artefact to one target." in deploy["doc"]not attributedassert "@version 3" in deploy["doc"]not attributedassert "#" not in deploy["doc"], "comment markers must be stripped, not served"not attributedassert "Undo the last deploy." in rollback["doc"]not attributed
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_a_hash_comment_block_above_the_function_is_its_doc→_harvestWhat 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.
Also reaches 1 requirement
Its run touches their code; that is reach, not proof.
- REQ-DDB-PIPE-012 measured