test_self_edge_rule_for_js_methods

Tests › tests/test_jsts.py

passed Passed in the packaged run.

What this test is for

Why it exists

The test says nothing about why.

Verifies REQ-DDB-PIPE-012

Given

  1. src = b"""\ class A { m() { m(); this.m(); } } function f() { f(); } """
→

When

  1. sites = set(_self_directed_sites(_tree("javascript", src), src))
→

Then

  1. ✓ sites contains ("m", 2)
  2. ✓ sites equals {("m", 2), ("f", 4)}

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

What it checks (2)

  1. assert ("m", 2) in sites, "this.m() inside m is self-directed" observes _self_directed_sites via sites
  2. assert sites == {("m", 2), ("f", 4)}, ( "a bare m() in a method is NOT the method (no implicit this)" ) observes _self_directed_sites via sites

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_self_edge_rule_for_js_methods→_self_directed_sites→_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
Also reaches 1 requirement

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