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

Function test_dql_data_driven_cases

graphlite/tests/dql_tests.rs:339–437  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

337
338#[test]
339fn test_dql_data_driven_cases() {
340 let test_suite = TestSuite {
341 name: "DQL Operations Test Suite".to_string(),
342 fixture_type: FixtureType::Fraud,
343 test_cases: vec![
344 // Basic MATCH tests
345 TestCase {
346 name: "match_all_nodes".to_string(),
347 description: "Match all nodes in the graph".to_string(),
348 query: "MATCH (n) RETURN count(n) as total".to_string(),
349 expected_rows: Some(1),
350 expected_values: Some(HashMap::from([("total".to_string(), Value::Number(70.0))])),
351 expected_error: None,
352 },
353 TestCase {
354 name: "match_with_label".to_string(),
355 description: "Match nodes with specific label".to_string(),
356 query: "MATCH (a:Account) RETURN count(a) as accounts".to_string(),
357 expected_rows: Some(1),
358 expected_values: Some(HashMap::from([(
359 "accounts".to_string(),
360 Value::Number(50.0),
361 )])),
362 expected_error: None,
363 },
364 TestCase {
365 name: "match_relationships".to_string(),
366 description: "Match relationships".to_string(),
367 query: "MATCH ()-[r:Transaction]->() RETURN count(r) as transactions".to_string(),
368 expected_rows: Some(1),
369 expected_values: Some(HashMap::from([(
370 "transactions".to_string(),
371 Value::Number(100.0),
372 )])),
373 expected_error: None,
374 },
375 // WHERE clause tests
376 TestCase {
377 name: "where_property_filter".to_string(),
378 description: "Filter nodes by property value".to_string(),
379 query:
380 "MATCH (a:Account) WHERE a.status = 'active' RETURN count(a) as active_accounts"
381 .to_string(),
382 expected_rows: Some(1),
383 expected_values: Some(HashMap::from([(
384 "active_accounts".to_string(),
385 Value::Number(50.0),
386 )])),
387 expected_error: None,
388 },
389 TestCase {
390 name: "where_range_filter".to_string(),
391 description: "Filter with range conditions".to_string(),
392 query:
393 "MATCH ()-[t:Transaction]->() WHERE t.amount > 50 RETURN count(t) as high_value"
394 .to_string(),
395 expected_rows: Some(1),
396 expected_values: None, // Don't check exact count, just verify it runs

Callers

nothing calls this directly

Calls 2

runMethod · 0.80
print_summaryMethod · 0.80

Tested by

no test coverage detected