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

Function test_count_substring

tests/test_cli.c:530–542  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

528 "<!-- codebase-memory-mcp:end -->\n";
529
530static size_t test_count_substring(const char *text, const char *needle) {
531 size_t count = 0U;
532 size_t needle_len = strlen(needle);
533 if (!text || needle_len == 0U) {
534 return 0U;
535 }
536 const char *cursor = text;
537 while ((cursor = strstr(cursor, needle)) != NULL) {
538 count++;
539 cursor += needle_len;
540 }
541 return count;
542}
543
544static size_t test_count_exec_hook(yyjson_val *root, const char *event_name,
545 const char *matcher_value, const char *expected_command,

Callers 1

test_cli.cFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected