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

Function test_bnf_function_compliance

graphlite/tests/function_tests.rs:413–463  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

411
412#[test]
413fn test_bnf_function_compliance() {
414 let _fixture = TestFixture::new().expect("Failed to create test fixture");
415 // Setup fresh graph for this test to avoid interference
416 _fixture
417 .setup_graph("test_bnf_function_compliance")
418 .expect("Failed to setup graph");
419 // Re-insert simple data since we have a fresh graph
420 _fixture
421 .insert_simple_data()
422 .expect("Failed to insert simple data");
423
424 // Test BNF-specified functions using data-driven approach
425 let test_suite = TestSuite {
426 name: "BNF Function Compliance Suite".to_string(),
427 fixture_type: FixtureType::Simple,
428 test_cases: vec![
429 // Aggregation functions (BNF specified)
430 TestCase {
431 name: "count_without_args".to_string(),
432 description: "COUNT() without args".to_string(),
433 query: "RETURN COUNT() as result".to_string(),
434 expected_rows: Some(1),
435 expected_values: None,
436 expected_error: None,
437 },
438 TestCase {
439 name: "datetime_function".to_string(),
440 description: "DATETIME function".to_string(),
441 query: "RETURN DATETIME('2023-01-01T00:00:00Z') as result".to_string(),
442 expected_rows: Some(1),
443 expected_values: None,
444 expected_error: None,
445 },
446 TestCase {
447 name: "now_function".to_string(),
448 description: "NOW function".to_string(),
449 query: "RETURN NOW() as result".to_string(),
450 expected_rows: Some(1),
451 expected_values: None,
452 expected_error: None,
453 },
454 ],
455 };
456
457 let results = test_suite
458 .run()
459 .expect("Failed to run BNF compliance suite");
460 results.print_summary();
461
462 let _total = results.passed + results.failed;
463}
464
465#[test]
466fn test_case_sensitivity_functions() {

Callers

nothing calls this directly

Calls 4

setup_graphMethod · 0.80
insert_simple_dataMethod · 0.80
runMethod · 0.80
print_summaryMethod · 0.80

Tested by

no test coverage detected