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

Function edge_present

tests/test_lang_contract.c:1101–1111  ·  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

1099/* Index `files`, assert the named edge type appears at least `floor` times.
1100 * On failure, dump the full edge histogram so a regression is diagnosable. */
1101static int edge_present(const LangFile *files, int nfiles, const char *edge, int floor) {
1102 LangProj lp;
1103 cbm_store_t *store = lang_index_files(&lp, files, nfiles);
1104 int got = store ? cbm_store_count_edges_by_type(store, lp.project, edge) : -1;
1105 if (got < floor) {
1106 fprintf(stderr, " [EDGE] FAIL %-20s count=%d expected>=%d\n", edge, got, floor);
1107 dump_edge_histogram(store, lp.project);
1108 }
1109 lang_cleanup(&lp, store);
1110 return got >= floor;
1111}
1112
1113/* DEFINES — File -> definition, once per top-level def (purely structural). */
1114TEST(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