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

Function gic_semantic_one

tests/test_gitignore_checked.c:114–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

112} gic_semantic;
113
114static bool gic_semantic_one(const gic_semantic *row) {
115 /* Legacy controls run first, so a broken fixture is not a feature failure. */
116 cbm_gitignore_t *legacy = cbm_gitignore_parse(row->patterns);
117 if (!legacy)
118 return false;
119 int old = cbm_gitignore_match_result(legacy, row->path, row->directory);
120 bool old_bool = cbm_gitignore_matches(legacy, row->path, row->directory);
121 cbm_gitignore_free(legacy);
122 if (old != (int)row->expected || old_bool != (row->expected == CBM_IGNORE_IGNORED))
123 return false;
124 cbm_ignore_checked_t *owner = NULL;
125 cbm_ignore_checked_limits_t limits = gic_limits();
126 const cbm_ignore_program_t *program = NULL;
127 bool ok = gic_open(&owner, &limits) &&
128 gic_parse(owner, row->patterns, strlen(row->patterns), row->count, &program) &&
129 gic_match(owner, program, row->path, row->directory, row->expected);
130 cbm_ignore_checked_free(owner);
131 return ok;
132}
133
134TEST(gic_a_semantics_and_legacy_parity) {
135 const gic_semantic rows[] = {

Callers 1

Calls 9

cbm_gitignore_parseFunction · 0.85
cbm_gitignore_matchesFunction · 0.85
cbm_gitignore_freeFunction · 0.85
gic_limitsFunction · 0.85
gic_openFunction · 0.85
gic_parseFunction · 0.85
gic_matchFunction · 0.85
cbm_ignore_checked_freeFunction · 0.85

Tested by

no test coverage detected