Skip to content

Commit 4a2ad91

Browse files
committed
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>
1 parent 198d5b3 commit 4a2ad91

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
@@ -612,9 +612,10 @@ static bool cx_pyrange_exact_control(cbm_store_t *store, const char *project,
612612
edges[i].properties_json
613613
? yyjson_read(edges[i].properties_json, strlen(edges[i].properties_json), 0)
614614
: NULL;
615-
const char *source =
616-
doc ? yyjson_get_str(yyjson_obj_get(yyjson_doc_get_root(doc), "source")) : NULL;
617-
if (source && strcmp(source, "lsp") == 0)
615+
/* an LSP resolution records an lsp_* strategy */
616+
const char *strategy =
617+
doc ? yyjson_get_str(yyjson_obj_get(yyjson_doc_get_root(doc), "strategy")) : NULL;
618+
if (strategy && strncmp(strategy, "lsp_", 4) == 0)
618619
exact++;
619620
yyjson_doc_free(doc);
620621
}

0 commit comments

Comments
 (0)