()
| 549 | |
| 550 | #[test] |
| 551 | fn test_parse_simple_plan() { |
| 552 | let json = r#"{ |
| 553 | "schema_version": 1, |
| 554 | "steps": [ |
| 555 | {"type": "kg_search", "query": "authentication", "limit": 5, "bind": "auth_nodes"} |
| 556 | ] |
| 557 | }"#; |
| 558 | let plan = parse_plan(json).unwrap(); |
| 559 | assert_eq!(plan.steps.len(), 1); |
| 560 | match &plan.steps[0] { |
| 561 | QueryStep::KgSearch { query, limit, bind } => { |
| 562 | assert_eq!(query, "authentication"); |
| 563 | assert_eq!(*limit, 5); |
| 564 | assert_eq!(bind.as_deref(), Some("auth_nodes")); |
| 565 | } |
| 566 | _ => panic!("Expected KgSearch step"), |
| 567 | } |
| 568 | } |
| 569 | |
| 570 | #[test] |
| 571 | fn test_parse_multi_step_plan() { |
nothing calls this directly
no test coverage detected