test(complexity): recognize the pyrange control calls by LSP strategy

cx_pyrange_exact_control counted edges with a "source":"lsp" property
that CALLS edges never carry, so every control failed and
complexity_py_module_ranges_preserve_calls_with_bounded_work reported
zero controls. Count edges whose strategy is lsp_*, the way the pyext
control and the pipeline tests recognize an LSP resolution.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
This commit is contained in:
Martin Vogel committed 2026-10-13 00:33:09 +02:00
1 parent 198d5b3651
commit 4a2ad91ce9
1 file changed
+4 -3
+4 -3
View File
@@ -612,9 +612,10 @@ static bool cx_pyrange_exact_control(cbm_store_t *store, const char *project,
edges[i].properties_json
? yyjson_read(edges[i].properties_json, strlen(edges[i].properties_json), 0)
: NULL;
const char *source =
doc ? yyjson_get_str(yyjson_obj_get(yyjson_doc_get_root(doc), "source")) : NULL;
if (source && strcmp(source, "lsp") == 0)
/* an LSP resolution records an lsp_* strategy */
const char *strategy =
doc ? yyjson_get_str(yyjson_obj_get(yyjson_doc_get_root(doc), "strategy")) : NULL;
if (strategy && strncmp(strategy, "lsp_", 4) == 0)
exact++;
yyjson_doc_free(doc);
}