From 96651170a0e5b6e60aa9e6e2e4bd173d11aec83e Mon Sep 17 00:00:00 2001 From: gvolfing Date: Tue, 12 Mar 2024 08:50:51 +0100 Subject: [PATCH] Add query plan test --- tests/unit/query_plan.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/unit/query_plan.cpp b/tests/unit/query_plan.cpp index 5b574c1ff..a059bc18b 100644 --- a/tests/unit/query_plan.cpp +++ b/tests/unit/query_plan.cpp @@ -1704,6 +1704,13 @@ TYPED_TEST(TestPlanner, ScanAllById) { CheckPlan(query, this->storage, ExpectScanAllById(), ExpectProduce()); } +TYPED_TEST(TestPlanner, ScanAllByEdgeId) { + // Test MATCH ()-[r]->() WHERE id(r) = 42 RETURN r + auto *query = QUERY(SINGLE_QUERY(MATCH(PATTERN(NODE("anon1"), EDGE("r"), NODE("anon2"))), + WHERE(EQ(FN("id", IDENT("r")), LITERAL(42))), RETURN("r"))); + CheckPlan(query, this->storage, ExpectScanAllByEdgeId(), ExpectProduce()); +} + TYPED_TEST(TestPlanner, BfsToExisting) { // Test MATCH (n)-[r *bfs]-(m) WHERE id(m) = 42 RETURN r auto *bfs = this->storage.template Create(