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

Function build_node_chain

tests/test_cypher.c:3554–3559  ·  view source on GitHub ↗

Build "MATCH (a0:NoSuchLabelXYZ)-[:CALLS]->(a1)-…->(aN-1)" into buf. The label * matches nothing, so any query built on it is instant and needs no fixture. */

Source from the content-addressed store, hash-verified

3552/* Build "MATCH (a0:NoSuchLabelXYZ)-[:CALLS]->(a1)-…->(aN-1)" into buf. The label
3553 * matches nothing, so any query built on it is instant and needs no fixture. */
3554static void build_node_chain(char *buf, size_t buf_sz, int nodes) {
3555 int off = snprintf(buf, buf_sz, "MATCH (a0:NoSuchLabelXYZ)");
3556 for (int i = 1; i < nodes; i++) {
3557 off += snprintf(buf + off, buf_sz - (size_t)off, "-[:CALLS]->(a%d)", i);
3558 }
3559}
3560
3561TEST(cypher_wide_pattern_refused) {
3562 /* A binding holds CYP_MAX_VARS (16) node variables, and binding_set drops

Callers 1

test_cypher.cFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected