test_a_hash_comment_block_above_the_function_is_its_doc

Tests › tests/test_shast.py

passed Passed in the packaged run.

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

  1. out = _harvest(_SCRIPT)
  2. deploy = next(fn for fn in out["functions"] if fn["name"] == "deploy")
  3. rollback = next(fn for fn in out["functions"] if fn["name"] == "rollback")
→

When

  1. —
→

Then

  1. ✓ deploy["doc"] contains "Deploy the built artefact to one target."
  2. ✓ deploy["doc"] contains "@version 3"
  3. ✓ deploy["doc"] does not contain "#"
  4. ✓ rollback["doc"] contains "Undo the last deploy."

tests/test_shast.py:83 · its file's page

What it checks (4)

  1. assert "Deploy the built artefact to one target." in deploy["doc"] not attributed
  2. assert "@version 3" in deploy["doc"] not attributed
  3. assert "#" not in deploy["doc"], "comment markers must be stripped, not served" not attributed
  4. assert "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→_harvest

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.

Also reaches 1 requirement

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