MCPcopy Create free account
hub / github.com/GraphLite-AI/GraphLite / test_complex_pattern_matching

Function test_complex_pattern_matching

graphlite/tests/fixture_tests.rs:313–341  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

311
312#[test]
313fn test_complex_pattern_matching() {
314 let fixture = TestFixture::new().expect("Failed to create test fixture");
315 // Setup fresh graph for this test to avoid interference
316 fixture
317 .setup_graph("test_complex_pattern_matching")
318 .expect("Failed to setup graph");
319 // Re-insert fraud data since we have a fresh graph
320 fixture
321 .insert_fraud_data()
322 .expect("Failed to insert fraud data");
323
324 // Test 1: Multi-hop patterns
325 let result = fixture.assert_query_succeeds(
326 "MATCH (a1:Account)-[:Transaction]->(m:Merchant)<-[:Transaction]-(a2:Account) RETURN count(DISTINCT m) as shared_merchants"
327 );
328 assert!(!result.rows.is_empty());
329
330 // Test 2: Simple pattern with filtering
331 let result = fixture.assert_query_succeeds(
332 "MATCH (a:Account)-[t:Transaction]->(m:Merchant) WHERE t.amount > 50 RETURN a.name, count(t) as high_value_txns ORDER BY high_value_txns DESC LIMIT 10"
333 );
334 assert!(!result.rows.is_empty());
335
336 // Test 3: Simple relationship patterns
337 let result = fixture.assert_query_succeeds(
338 "MATCH (a:Account)-[:Transaction]->(m:Merchant) WHERE a.balance > 2000 RETURN count(DISTINCT m) as merchant_count"
339 );
340 assert!(!result.rows.is_empty());
341}
342
343#[test]
344fn test_with_clause_basic_aggregation() {

Callers

nothing calls this directly

Calls 3

setup_graphMethod · 0.80
insert_fraud_dataMethod · 0.80
assert_query_succeedsMethod · 0.45

Tested by

no test coverage detected