test_a_c_tree_yields_no_shell_definitions¶
Tests › tests/test_shast.py
What this test is for
Why it exists
C spells its definition `function_definition` too — the same node name — and is separated only by the absence of a `word` name field.
Given
src = b"int main(void) { return 0; }\n"tree = lps.parse_tree("c", src)
When
is_sh_tree(tree)
Then
- ✓ set(tree.kinds) contains "function_definition"
- ✓ is_sh_tree(tree) is false
- ✓ harvest_definitions(tree, src) equals {"functions": [], "classes": []}
tests/test_shast.py:129 · its file's page
What it checks (3)
assert "function_definition" in set(tree.kinds), "the premise of this test"not attributedassert not is_sh_tree(tree)observesis_sh_treeassert harvest_definitions(tree, src) == {"functions": [], "classes": []}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_c_tree_yields_no_shell_definitions→is_sh_treeWhat 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