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

Function test_query_plan_json_roundtrip

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

Source from the content-addressed store, hash-verified

749
750 #[test]
751 fn test_query_plan_json_roundtrip() {
752 let plan = QueryPlan {
753 steps: vec![
754 QueryStep::KgSearch {
755 query: "auth".to_string(),
756 limit: 5,
757 bind: Some("results".to_string()),
758 },
759 QueryStep::Filter {
760 input: "results".to_string(),
761 field: "kind".to_string(),
762 equals: Some("intent".to_string()),
763 not_equals: None,
764 bind: Some("intents".to_string()),
765 },
766 QueryStep::KgNeighbors {
767 node_id: "$intents".to_string(),
768 depth: 2,
769 bind: None,
770 },
771 ],
772 };
773 let json = serde_json::to_string_pretty(&plan).unwrap();
774 let parsed = parse_plan(&json).unwrap();
775 assert_eq!(parsed.steps.len(), 3);
776 }
777
778 #[test]
779 fn test_execute_plan_simple() {

Callers

nothing calls this directly

Calls 2

parse_planFunction · 0.85
unwrapMethod · 0.45

Tested by

no test coverage detected