| 528 | "<!-- codebase-memory-mcp:end -->\n"; |
| 529 | |
| 530 | static 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 | |
| 544 | static size_t test_count_exec_hook(yyjson_val *root, const char *event_name, |
| 545 | const char *matcher_value, const char *expected_command, |