()
| 5510 | |
| 5511 | #[test] |
| 5512 | fn test_parser_with_clause_aggregation() { |
| 5513 | let query = "MATCH (a:Account)-[t:Transaction]->(m:Merchant) |
| 5514 | WITH a, m, count(t) as transaction_count, sum(t.amount) as total_spent |
| 5515 | WHERE transaction_count > 5 |
| 5516 | MATCH (m)<-[:Transaction]-(other:Account) |
| 5517 | WHERE other <> a |
| 5518 | RETURN a.account_number, |
| 5519 | m.name, |
| 5520 | transaction_count, |
| 5521 | total_spent, |
| 5522 | count(DISTINCT other) as fellow_customers |
| 5523 | ORDER BY total_spent DESC |
| 5524 | LIMIT 10"; |
| 5525 | let result = parse_query(query); |
| 5526 | assert!( |
| 5527 | result.is_ok(), |
| 5528 | "WITH clause with aggregation should parse. Error: {:?}", |
| 5529 | result.err() |
| 5530 | ); |
| 5531 | } |
| 5532 | |
| 5533 | #[test] |
| 5534 | fn test_parser_simple_with_clause() { |
nothing calls this directly
no test coverage detected