()
| 12 | |
| 13 | #[test] |
| 14 | fn test_basic_match_operations() { |
| 15 | let fixture = TestFixture::new().expect("Failed to create test fixture"); |
| 16 | // Setup fresh graph for this test to avoid interference |
| 17 | fixture |
| 18 | .setup_graph("test_basic_match_operations") |
| 19 | .expect("Failed to setup graph"); |
| 20 | // Re-insert fraud data since we have a fresh graph |
| 21 | fixture |
| 22 | .insert_fraud_data() |
| 23 | .expect("Failed to insert fraud data"); |
| 24 | |
| 25 | // Test simple node matching |
| 26 | let result = fixture.assert_query_succeeds("MATCH (n) RETURN count(n) as total_nodes"); |
| 27 | assert_eq!(result.rows.len(), 1); |
| 28 | |
| 29 | // Test labeled node matching |
| 30 | fixture.assert_first_value( |
| 31 | "MATCH (a:Account) RETURN count(a) as account_count", |
| 32 | "account_count", |
| 33 | Value::Number(50.0), |
| 34 | ); |
| 35 | |
| 36 | fixture.assert_first_value( |
| 37 | "MATCH (m:Merchant) RETURN count(m) as merchant_count", |
| 38 | "merchant_count", |
| 39 | Value::Number(20.0), |
| 40 | ); |
| 41 | |
| 42 | // Test relationship matching |
| 43 | fixture.assert_first_value( |
| 44 | "MATCH ()-[r:Transaction]->() RETURN count(r) as transaction_count", |
| 45 | "transaction_count", |
| 46 | Value::Number(100.0), // Updated to match what fixture creates |
| 47 | ); |
| 48 | |
| 49 | fixture.assert_first_value( |
| 50 | "MATCH ()-[r:Purchase]->() RETURN count(r) as purchase_count", |
| 51 | "purchase_count", |
| 52 | Value::Number(50.0), // Updated to match what fixture creates |
| 53 | ); |
| 54 | |
| 55 | // Test pattern matching |
| 56 | fixture.assert_query_succeeds( |
| 57 | "MATCH (a:Account)-[t:Transaction]->(m:Merchant) |
| 58 | RETURN count(*) as pattern_count", |
| 59 | ); |
| 60 | |
| 61 | // Test bidirectional relationship matching |
| 62 | let result = fixture.assert_query_succeeds( |
| 63 | "MATCH (a:Account)-[r]-(m:Merchant) |
| 64 | RETURN count(r) as bidirectional_count", |
| 65 | ); |
| 66 | assert!(!result.rows.is_empty()); |
| 67 | } |
| 68 | |
| 69 | #[test] |
| 70 | fn test_where_clause_operations() { |
nothing calls this directly
no test coverage detected