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

Function test_debug_relationships

graphlite/tests/set_operations_tests.rs:417–455  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

415
416#[test]
417fn test_debug_relationships() {
418 let fixture = create_tutorial_test_fixture().expect("Failed to create test fixture");
419
420 // First, test that relationships exist
421 let query1 = "MATCH (p:Person)-[:WORKS_IN]->(d:Department) RETURN p.name, d.name";
422 let result1 = fixture
423 .query(query1)
424 .expect("Basic relationship query should succeed");
425
426 log::debug!("All WORKS_IN relationships: {} rows", result1.rows.len());
427 for row in &result1.rows {
428 let person = row.values["p.name"].as_string().unwrap();
429 let dept = row.values["d.name"].as_string().unwrap();
430 log::debug!(" {} works in {}", person, dept);
431 }
432
433 // Test individual relationship queries
434 let query2 = "MATCH (p:Person)-[:WORKS_IN]->(d:Department {name: 'IT'}) RETURN p.name";
435 let result2 = fixture
436 .query(query2)
437 .expect("IT relationship query should succeed");
438
439 log::debug!("People in IT: {} rows", result2.rows.len());
440 for row in &result2.rows {
441 let person = row.values["p.name"].as_string().unwrap();
442 log::debug!(" {} works in IT", person);
443 }
444
445 let query3 = "MATCH (p:Person)-[:WORKS_IN]->(d:Department {name: 'Engineering'}) RETURN p.name";
446 let result3 = fixture
447 .query(query3)
448 .expect("Engineering relationship query should succeed");
449
450 log::debug!("People in Engineering: {} rows", result3.rows.len());
451 for row in &result3.rows {
452 let person = row.values["p.name"].as_string().unwrap();
453 log::debug!(" {} works in Engineering", person);
454 }
455}
456
457#[test]
458fn test_union_all_with_relationships() {

Callers

nothing calls this directly

Calls 4

unwrapMethod · 0.80
queryMethod · 0.45
as_stringMethod · 0.45

Tested by

no test coverage detected