()
| 460 | |
| 461 | #[test] |
| 462 | fn test_parse_simple_plan() { |
| 463 | let json = r#"{ |
| 464 | "steps": [ |
| 465 | {"type": "kg_search", "query": "authentication", "limit": 5, "bind": "auth_nodes"} |
| 466 | ] |
| 467 | }"#; |
| 468 | let plan = parse_plan(json).unwrap(); |
| 469 | assert_eq!(plan.steps.len(), 1); |
| 470 | match &plan.steps[0] { |
| 471 | QueryStep::KgSearch { query, limit, bind } => { |
| 472 | assert_eq!(query, "authentication"); |
| 473 | assert_eq!(*limit, 5); |
| 474 | assert_eq!(bind.as_deref(), Some("auth_nodes")); |
| 475 | } |
| 476 | _ => panic!("Expected KgSearch step"), |
| 477 | } |
| 478 | } |
| 479 | |
| 480 | #[test] |
| 481 | fn test_parse_multi_step_plan() { |
nothing calls this directly
no test coverage detected