MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / test_parse_simple_plan

Function test_parse_simple_plan

atomic-repository/src/query_plan.rs:462–478  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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() {

Callers

nothing calls this directly

Calls 2

parse_planFunction · 0.85
unwrapMethod · 0.45

Tested by

no test coverage detected