MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / edge_present

Function edge_present

tests/test_lang_contract.c:1045–1055  ·  view source on GitHub ↗

Index `files`, assert the named edge type appears at least `floor` times. * On failure, dump the full edge histogram so a regression is diagnosable. */

Source from the content-addressed store, hash-verified

1043/* Index `files`, assert the named edge type appears at least `floor` times.
1044 * On failure, dump the full edge histogram so a regression is diagnosable. */
1045static int edge_present(const LangFile *files, int nfiles, const char *edge, int floor) {
1046 LangProj lp;
1047 cbm_store_t *store = lang_index_files(&lp, files, nfiles);
1048 int got = store ? cbm_store_count_edges_by_type(store, lp.project, edge) : -1;
1049 if (got < floor) {
1050 fprintf(stderr, " [EDGE] FAIL %-20s count=%d expected>=%d\n", edge, got, floor);
1051 dump_edge_histogram(store, lp.project);
1052 }
1053 lang_cleanup(&lp, store);
1054 return got >= floor;
1055}
1056
1057/* DEFINES — File -> definition, once per top-level def (purely structural). */
1058TEST(contract_edge_defines) {

Callers 1

Calls 4

lang_index_filesFunction · 0.85
dump_edge_histogramFunction · 0.85
lang_cleanupFunction · 0.85

Tested by

no test coverage detected