test_diff_range_that_looks_like_an_option_is_refused¶
Tests › tests/guard/test_guard_git.py
What this test is for
Why it exists
git diff supports --output=<file>, an arbitrary write primitive.
Given
called: list[list[str]] = []def capture(cmd): called.append(cmd) return ""
When
get_diff("a.c", "--output=/tmp/pwned", capture)
Then
- ✓ get_diff("a.c", "--output=/tmp/pwned", capture) is None
- ✓ called equals []
tests/guard/test_guard_git.py:258 · its file's page
What it checks (2)
assert get_diff("a.c", "--output=/tmp/pwned", capture) is Noneobservesget_diffassert called == []not attributed
Where the product reaches it
main→_run→run_precommit→impact_report→collect_changes→_collect_changed_lines→_get_file_diff→get_diff(flow)
Call flow
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 2 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-CONFIG-001 inferred
- REQ-DDB-GUARD-023 measured