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

Function test_call_complex_where_expression

graphlite/src/ast/parser.rs:5352–5380  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5350
5351#[test]
5352fn test_call_complex_where_expression() {
5353 // Combined test: Complex WHERE with IN, OR, and description in YIELD
5354 let query = r#"CALL system.list_functions()
5355YIELD name, category, description
5356WHERE category IN ('string', 'numeric') OR category = 'aggregate';"#;
5357
5358 let result = parse_query(query);
5359 assert!(result.is_ok(), "Failed to parse complex WHERE expression");
5360
5361 let doc = result.unwrap();
5362 if let Statement::Call(ref call_stmt) = doc.statement {
5363 assert!(call_stmt.yield_clause.is_some(), "YIELD should be present");
5364 assert!(call_stmt.where_clause.is_some(), "WHERE should be present");
5365
5366 // Verify it's an OR expression
5367 match &call_stmt.where_clause.as_ref().unwrap().condition {
5368 Expression::Binary(binary) => {
5369 assert_eq!(
5370 binary.operator,
5371 Operator::Or,
5372 "Top-level should be OR operator"
5373 );
5374 }
5375 other => panic!("Expected OR binary expression, got {:?}", other),
5376 }
5377 } else {
5378 panic!("Expected CallStatement");
5379 }
5380}
5381
5382#[test]
5383fn test_call_valid_without_where() {

Callers

nothing calls this directly

Calls 2

parse_queryFunction · 0.85
unwrapMethod · 0.80

Tested by

no test coverage detected