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

Function test_call_with_description_in_yield

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

Source from the content-addressed store, hash-verified

5155
5156#[test]
5157fn test_call_with_description_in_yield() {
5158 // Bug #1: 'description' is a keyword but should be allowed as column name in YIELD
5159 let query = r#"CALL system.list_functions()
5160YIELD name, category, description;"#;
5161
5162 let result = parse_query(query);
5163 assert!(
5164 result.is_ok(),
5165 "Failed to parse CALL with 'description' in YIELD"
5166 );
5167
5168 let doc = result.unwrap();
5169 if let Statement::Call(ref call_stmt) = doc.statement {
5170 assert_eq!(call_stmt.procedure_name, "system.list_functions");
5171
5172 let yield_clause = call_stmt
5173 .yield_clause
5174 .as_ref()
5175 .expect("YIELD clause should be present");
5176
5177 assert_eq!(yield_clause.items.len(), 3, "Should have 3 YIELD items");
5178 assert_eq!(yield_clause.items[0].column_name, "name");
5179 assert_eq!(yield_clause.items[1].column_name, "category");
5180 assert_eq!(yield_clause.items[2].column_name, "description");
5181 } else {
5182 panic!(
5183 "Expected CallStatement, got {:?}",
5184 std::mem::discriminant(&doc.statement)
5185 );
5186 }
5187}
5188
5189#[test]
5190fn test_call_with_where_and_description() {

Callers

nothing calls this directly

Calls 2

parse_queryFunction · 0.85
unwrapMethod · 0.80

Tested by

no test coverage detected