test_git_add_uses_double_dash

Tests › tests/guard/test_guard_git.py

passed Passed in the packaged run.

What this test is for

Why it exists

The test says nothing about why.

Given

  1. seen: list[list[str]] = []
  2. def capture(cmd): seen.append(cmd) return ""
→

When

  1. git_add(["-weird-name.md"], capture)
→

Then

  1. ✓ seen[0] contains "--"
  2. ✓ seen[0].index("--") is less than seen[0].index("-weird-name.md")

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

… 65 earlier steps

program launcherprogram launcherprogram launcherprogram launcherother filesother filesother filesother filesopt (line 1336)optalt (line 1344)altmain66–67. read_catalog_at → git_text66git_text +1 more68–69. git_argv → _no_ext_diff68_no_ext_diff +1 more70–71. read_catalog_at → _refuse_url70_refuse_url +1 more

… 157 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.pyother filesother filesother filesother filesopt (line 265)optmain229. validate_file → get_file_at_revision229get_file_at_revision230. get_file_at_revision → run_git230run_git231. run_git → git_argv231git_argv232. validate_file → parse_content_for_file232parse_content_for_file233. validate_file → check_version_staleness233check_version_staleness

… 56 steps between

program launcherprogram launcherprogram launcherprogram launcherclew/guard/main.pyclew/guard/main.pyclew/guard/main.pyclew/guard/main.pyclew/guard/impact.pyclew/guard/impact.pyclew/guard/impact.pyclew/guard/impact.pyother filesother filesother filesother filesopt (line 482)optmain290. _write_report → format_json290format_json291. run_precommit → git_add291git_add292. git_add → run_git292run_git▶ test enters293. run_precommit → format_markdown293format_markdown294. run_precommit → _coverage_gate294_coverage_gate

… 63 later steps

4 more

tests/guard/test_guard_git.py:247 · its file's page

What it checks (2)

  1. assert "--" in seen[0] not attributed
  2. assert seen[0].index("--") < seen[0].index("-weird-name.md") not attributed

Where the product reaches it

  • main → _run → run_precommit → git_add (flow)

Call flow

test_git_add_uses_double_dash→git_add

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_git_add_uses_double_dash · 2 checksgit_addrun_gitgit_argvREQ-DDB-CONFIG-001 · measuredgit_addrun_gitREQ-DDB-GUARD-023 · measured
Also reaches 2 requirements

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