test_a_javascript_tree_yields_no_shell_definitions

Tests › tests/test_shast.py

passed Passed in the packaged run.

What this test is for

Why it exists

THE COLLISION, pinned. Both trees are rooted at `program`, so this harvester is offered JS trees by the shared parse and must return nothing for them.

Given

  1. src = b"function foo(a) { return a; }\nconst bar = () => 1;\n"
  2. tree = lps.parse_tree("javascript", src)
→

When

  1. is_sh_tree(tree)
→

Then

  1. ✓ tree.root_node.type equals "program"
  2. ✓ is_sh_tree(tree) is false
  3. ✓ harvest_definitions(tree, src) equals {"functions": [], "classes": []}

tests/test_shast.py:115 · its file's page

What it checks (3)

  1. assert tree.root_node.type == "program", "the premise of this test" not attributed
  2. assert not is_sh_tree(tree) observes is_sh_tree
  3. assert 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_javascript_tree_yields_no_shell_definitions→is_sh_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.

Also reaches 1 requirement

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