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

Function test_match_delete_basic

graphlite/tests/match_with_tests.rs:1372–1408  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1370
1371#[test]
1372fn test_match_delete_basic() {
1373 let fixture = TestFixture::empty().expect("Failed to create test fixture");
1374
1375 fixture
1376 .query(&format!(
1377 "CREATE SCHEMA IF NOT EXISTS /{}",
1378 fixture.schema_name()
1379 ))
1380 .unwrap();
1381 fixture
1382 .query(&format!(
1383 "CREATE GRAPH /{}/basic_delete",
1384 fixture.schema_name()
1385 ))
1386 .unwrap();
1387 fixture
1388 .query(&format!(
1389 "SESSION SET GRAPH /{}/basic_delete",
1390 fixture.schema_name()
1391 ))
1392 .unwrap();
1393
1394 // Insert test data
1395 fixture.assert_query_succeeds(
1396 "INSERT (post1:Post {id: 1, title: 'Post 1'}),
1397 (post2:Post {id: 2, title: 'Post 2'}),
1398 (post3:Post {id: 3, title: 'Post 3'})",
1399 );
1400
1401 // Test basic MATCH-DELETE without WITH or WHERE
1402 fixture.assert_query_succeeds("MATCH (p:Post) DETACH DELETE p");
1403 fixture.assert_first_value(
1404 "MATCH (p:Post) RETURN count(p) as count",
1405 "count",
1406 Value::Number(0.0),
1407 );
1408}
1409
1410#[test]
1411fn test_match_delete_with_where_only() {

Callers

nothing calls this directly

Calls 4

unwrapMethod · 0.80
assert_first_valueMethod · 0.80
queryMethod · 0.45
assert_query_succeedsMethod · 0.45

Tested by

no test coverage detected