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:850–878  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

848
849 #[test]
850 fn test_query_plan_json_roundtrip() {
851 let plan = QueryPlan {
852 schema_version: 1,
853 steps: vec![
854 QueryStep::KgSearch {
855 query: "auth".to_string(),
856 limit: 5,
857 bind: Some("results".to_string()),
858 },
859 QueryStep::Filter {
860 input: "results".to_string(),
861 field: "type".to_string(),
862 equals: Some(Class::WorkIntent.iri().to_string()),
863 not_equals: None,
864 bind: Some("intents".to_string()),
865 },
866 QueryStep::KgNeighbors {
867 node_id: "$intents".to_string(),
868 depth: 2,
869 predicate: Some(Predicate::DependsOnIntent),
870 direction: Direction::Outgoing,
871 bind: None,
872 },
873 ],
874 };
875 let json = serde_json::to_string_pretty(&plan).unwrap();
876 let parsed = parse_plan(&json).unwrap();
877 assert_eq!(parsed.steps.len(), 3);
878 }
879
880 #[test]
881 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