test_a_bash_script_is_not_a_js_tree¶
Tests › tests/test_jsts.py
What this test is for
Why it exists
tree-sitter-bash ALSO roots at `program`, so the root alone said every shell script was JavaScript. It was harmless while a bash tree yielded no JS definitions; it surfaced when every JS/TS file gained a `__module__` row and shell scripts got one too. A bash-only node kind (`command`, `word`, ...) in the tree settles it.
Verifies REQ-DDB-PIPE-012
Given
- —
When
is_js_tree(_tree("bash", b"echo hi\n"))is_js_tree(_tree("bash", b"X=1\nmake build | tee log\n"))is_js_tree(_tree("typescript", b"const x = 1;\n"))
Then
- ✓ is_js_tree(_tree("bash", b"echo hi\n")) is false
- ✓ is_js_tree(_tree("bash", b"X=1\nmake build | tee log\n")) is false
- ✓ is_js_tree(_tree("typescript", b"const x = 1;\n")) holds
tests/test_jsts.py:104 · its file's page
What it checks (3)
assert not is_js_tree(_tree("bash", b"echo hi\n"))observesis_js_treeassert not is_js_tree(_tree("bash", b"X=1\nmake build | tee log\n"))observesis_js_treeassert is_js_tree(_tree("typescript", b"const x = 1;\n"))observesis_js_tree
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_bash_script_is_not_a_js_tree→_tree→is_js_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.
Requirements it verifies (1)
| requirement | linked by | implementers exercised |
|---|---|---|
| REQ-DDB-PIPE-012 | catalog | unknown |