()
| 267 | |
| 268 | #[test] |
| 269 | fn test_pattern_comprehensions() { |
| 270 | let fixture = TestFixture::with_fraud_data().expect("Failed to create test fixture"); |
| 271 | |
| 272 | // Test pattern matching for collecting related data using ISO GQL compliant syntax |
| 273 | let result = fixture.assert_query_succeeds( |
| 274 | "MATCH (a:Account)-[t:Transaction]->(m:Merchant) |
| 275 | RETURN a.account_number, |
| 276 | t.amount as transaction_amount, |
| 277 | m.category as merchant_category |
| 278 | LIMIT 10", |
| 279 | ); |
| 280 | assert!(result.rows.len() <= 10); |
| 281 | |
| 282 | // Test pattern matching with filtering for large transactions |
| 283 | let result = fixture.assert_query_succeeds( |
| 284 | "MATCH (a:Account)-[t:Transaction]->(m:Merchant) |
| 285 | WHERE t.amount > 10000 |
| 286 | RETURN a.account_number, |
| 287 | m.name as merchant, |
| 288 | t.amount as amount |
| 289 | ORDER BY t.amount DESC |
| 290 | LIMIT 10", |
| 291 | ); |
| 292 | assert!(result.rows.len() <= 10); |
| 293 | |
| 294 | // Test pattern matching for revenue calculations |
| 295 | let result = fixture.assert_query_succeeds( |
| 296 | "MATCH (m:Merchant)<-[t:Transaction]-(a:Account) |
| 297 | RETURN m.name, |
| 298 | count(t) as transaction_count, |
| 299 | sum(t.amount) as total_revenue |
| 300 | GROUP BY m.name |
| 301 | ORDER BY sum(t.amount) DESC |
| 302 | LIMIT 10", |
| 303 | ); |
| 304 | assert!(result.rows.len() <= 10); |
| 305 | } |
| 306 | |
| 307 | #[test] |
| 308 | fn test_pattern_data_driven_cases() { |
nothing calls this directly
no test coverage detected