Skip to content

Commit 14d0fda

Browse files
committed
test(complexity): recognize the pyext control call by its LSP strategy
cx_pyext_control looked for a "source":"lsp" property that CALLS edges never carry, so the control count was always zero and complexity_py_submodule_probe_avoids_registry_scan failed even though every cx_pyext_use() kept its local call. An LSP resolution records an lsp_* strategy (lsp_direct for this call), the same check the pipeline tests use. Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
1 parent 033c1e0 commit 14d0fda

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

‎tests/test_complexity.c‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -491,11 +491,12 @@ static bool cx_pyext_control(cbm_store_t *store, const char *project, const cbm_
491491
for (int i = 0; i < count; i++) {
492492
if (edges[i].target_id != target.id || !edges[i].properties_json)
493493
continue;
494+
/* an LSP resolution records an lsp_* strategy (lsp_direct here) */
494495
yyjson_doc *doc =
495496
yyjson_read(edges[i].properties_json, strlen(edges[i].properties_json), 0);
496-
const char *source =
497-
doc ? yyjson_get_str(yyjson_obj_get(yyjson_doc_get_root(doc), "source")) : NULL;
498-
found = found || (source && strcmp(source, "lsp") == 0);
497+
const char *strategy =
498+
doc ? yyjson_get_str(yyjson_obj_get(yyjson_doc_get_root(doc), "strategy")) : NULL;
499+
found = found || (strategy && strncmp(strategy, "lsp_", 4) == 0);
499500
yyjson_doc_free(doc);
500501
}
501502
}

0 commit comments

Comments
 (0)