test_a_commented_argument_does_not_shift_the_timeout

Tests › tests/test_locks.py

passed Passed in the packaged run.

What this test is for

Why it exists

A COMMENT IS A NAMED CHILD of the argument list in tree-sitter-c, so reading the Nth named child reads the wrong argument the moment anyone documents one inline — which vendor headers and RTOS demos do constantly.

Given

  1. src = b"""\ void f(void) { xEventGroupWaitBits(eg, BIT0, /* xClearOnExit */ pdTRUE, pdFALSE, portMAX_DELAY); k_sem_take(&sem, /* wait */ K_FOREVER); } """
  2. parser = Parser("c")
→

When

  1. sites = walk_blocking_sites( parser.parse(src), src, {p.name: p for p in DEFAULT_BLOCKING_PATTERNS} )
  2. waits = {site[0]: (site[2], site[3]) for site in sites}
→

Then

  1. ✓ waits["xEventGroupWaitBits"] equals ("forever", "portMAX_DELAY")
  2. ✓ waits["k_sem_take"] equals ("forever", "K_FOREVER")

tests/test_locks.py:563 · its file's page

What it checks (2)

  1. assert waits["xEventGroupWaitBits"] == ("forever", "portMAX_DELAY"), ( f"the comment must not shift the timeout argument, got {waits['xEventGroupWaitBits']}" ) not attributed
  2. assert waits["k_sem_take"] == ("forever", "K_FOREVER"), ( f"same for a comment sitting immediately before the timeout, got {waits['k_sem_take']}" ) 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_commented_argument_does_not_shift_the_timeout→walk_blocking_sites

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.

test_a_commented_argument_does_not_shift_the_timeout · 2 checkswalk_blocking_sites_enclosing_conditionenclosingREQ-DDB-PIPE-003 · measured
Also reaches 1 requirement

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