test_a_bash_script_is_not_a_js_tree

Tests › tests/test_jsts.py

passed Passed in the packaged run.

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

  1. —
→

When

  1. is_js_tree(_tree("bash", b"echo hi\n"))
  2. is_js_tree(_tree("bash", b"X=1\nmake build | tee log\n"))
  3. is_js_tree(_tree("typescript", b"const x = 1;\n"))
→

Then

  1. ✓ is_js_tree(_tree("bash", b"echo hi\n")) is false
  2. ✓ is_js_tree(_tree("bash", b"X=1\nmake build | tee log\n")) is false
  3. ✓ is_js_tree(_tree("typescript", b"const x = 1;\n")) holds

tests/test_jsts.py:104 · its file's page

What it checks (3)

  1. assert not is_js_tree(_tree("bash", b"echo hi\n")) observes is_js_tree
  2. assert not is_js_tree(_tree("bash", b"X=1\nmake build | tee log\n")) observes is_js_tree
  3. assert is_js_tree(_tree("typescript", b"const x = 1;\n")) observes is_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_tree

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.

Requirements it verifies (1)

requirementlinked byimplementers exercised
REQ-DDB-PIPE-012catalogunknown