()
| 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() { |
nothing calls this directly
no test coverage detected