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

Function edge_present

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

875/* Index `files`, assert the named edge type appears at least `floor` times.
876 * On failure, dump the full edge histogram so a regression is diagnosable. */
877static int edge_present(const LangFile *files, int nfiles, const char *edge, int floor) {
878 LangProj lp;
879 cbm_store_t *store = lang_index_files(&lp, files, nfiles);
880 int got = store ? cbm_store_count_edges_by_type(store, lp.project, edge) : -1;
881 if (got < floor) {
882 fprintf(stderr, " [EDGE] FAIL %-20s count=%d expected>=%d\n", edge, got, floor);
883 dump_edge_histogram(store, lp.project);
884 }
885 lang_cleanup(&lp, store);
886 return got >= floor;
887}
888
889/* DEFINES — File -> definition, once per top-level def (purely structural). */
890TEST(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