MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / test_BothDirections

Function test_BothDirections

tests/unit/test_algebraic_expression.c:1154–1171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1152}
1153
1154void test_BothDirections() {
1155 const char *q =
1156 "MATCH (p:Person)-[ef:friend]->(f:Person)<-[ev:visit]-(c:City)-[ew:war]->(e:City) RETURN p,e";
1157 AST *master_ast;
1158 AlgebraicExpression **actual = build_algebraic_expression(q, &master_ast);
1159 uint exp_count = array_len(actual);
1160 TEST_ASSERT(exp_count == 1);
1161
1162 AlgebraicExpression *expected[1];
1163 expected[0] = AlgebraicExpression_FromString("p*F*f*tV*c*W*e", _matrices);
1164 compare_algebraic_expressions(actual, expected, 1);
1165
1166 // Clean up.
1167 free_algebraic_expressions(actual, exp_count);
1168 free_algebraic_expressions(expected, exp_count);
1169 array_free(actual);
1170 AST_Free(master_ast);
1171}
1172
1173void test_SingleNode() {
1174 const char *q = "MATCH (p:Person) RETURN p";

Callers

nothing calls this directly

Calls 7

array_lenFunction · 0.85
array_freeFunction · 0.85
AST_FreeFunction · 0.85

Tested by

no test coverage detected