test_a_lock_declaration_with_releases_is_accepted_on_both_routes¶
Tests › tests/test_buildoptions.py
What this test is for
Why it exists
TWO DOCUMENTS DISAGREEING ABOUT ONE FACT, for the third time in this area. The loader `locks._declared_lock_pattern` reads `releases`, and this module's entry schema omitted it — so the SAME declaration was accepted from a `.clew.yaml` file and REFUSED as an inline build option.
Verifies REQ-DDB-CONFIG-008
Given
document = { "locks": [ { "name": "mbedtls_mutex_lock", "form": "call", "releases": "mbedtls_mutex_unlock", "kind": "mutex", "mode": "exclusive", "role": "scoped", "operand_index": 0, } ] }
When
bo._checked_document("locks", document)patterns = {p.name: p for p in load_lock_patterns(document)}declared = patterns["mbedtls_mutex_lock"]
Then
- ✓ bo._checked_document("locks", document) equals document
- ✓ declared.releases equals "mbedtls_mutex_unlock"
- ✓ declared.form equals "call"
- ✓ declared.operand_index equals 0
- ✓ patterns contains "lock_guard"
What it exercises
The parts of the system's flows this test ran, measured by per-test coverage: lit steps ran in this test, dimmed ones did not, and ▶ marks where the test called in. Each title opens the whole flow with these steps lit.
thread `clew-first-build-` — `_first_build_worker` (clew/mcp_server/server.py) · 2 of 142 steps
… 123 earlier steps
… 13 later steps
2 more
- clew — `main` (clew/cli.py) · 2 of 400 steps
- Build this wiki from the index · 1 of 400 steps
tests/test_buildoptions.py:525 · its file's page
What it checks (5)
assert bo._checked_document("locks", document) == document, ( "the inline route must accept every key the loader reads" )observes_checked_documentassert declared.releases == "mbedtls_mutex_unlock", ( "without a release token every critical-section extent stays NULL" )not attributedassert declared.form == "call"not attributedassert declared.operand_index == 0not attributedassert "lock_guard" in patternsobservesload_lock_patternsviapatterns
Where the product reaches it
main→propose_main→propose→build_context→load_declaration→load_declaration_located→_checked_sections→_checked_section→check_manifest_document→_checked_document(flow)
Call flow
test_a_lock_declaration_with_releases_is_accepted_on_both_routes→_checked_document→load_lock_patternsWhat 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-CONFIG-008 | catalog | unknown |
Also reaches 2 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-SCHEMA-011 measured
- REQ-DDB-SCHEMA-012 measured