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

Function test_readme_delete_node

graphlite/tests/readme_examples_test.rs:446–473  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

444
445#[test]
446fn test_readme_delete_node() {
447 let fixture = TestFixture::new().expect("Failed to create fixture");
448 fixture
449 .setup_graph("readme_delete_test")
450 .expect("Failed to setup graph");
451
452 // Create nodes
453 fixture
454 .query("INSERT (:Person {name: 'Bob'}), (:Person {name: 'Alice'})")
455 .expect("Insert should succeed");
456
457 // Delete nodes
458 fixture
459 .query("MATCH (p:Person {name: 'Bob'}) DELETE p")
460 .expect("DELETE should succeed");
461
462 // Verify Bob is deleted
463 let result = fixture
464 .query("MATCH (p:Person {name: 'Bob'}) RETURN p")
465 .expect("Query should succeed");
466 assert_eq!(result.rows.len(), 0, "Bob should be deleted");
467
468 // Verify Alice still exists
469 let result = fixture
470 .query("MATCH (p:Person {name: 'Alice'}) RETURN p")
471 .expect("Query should succeed");
472 assert_eq!(result.rows.len(), 1, "Alice should still exist");
473}
474
475// ============================================================================
476// Aggregation Examples Tests

Callers

nothing calls this directly

Calls 2

setup_graphMethod · 0.80
queryMethod · 0.45

Tested by

no test coverage detected