| 810 | |
| 811 | #[test] |
| 812 | fn test_plan_result_serialization() { |
| 813 | let result = PlanResult { |
| 814 | patch_evidence: vec![], |
| 815 | nodes: vec![KgNode::new("a", Class::WorkIntent, "A", "test")], |
| 816 | edges: vec![KgEdge::new("a", "b", Predicate::DependsOnIntent)], |
| 817 | content: HashMap::new(), |
| 818 | step_stats: vec![StepStat { |
| 819 | step_type: "kg_search".to_string(), |
| 820 | result_count: 1, |
| 821 | elapsed_ms: 5, |
| 822 | }], |
| 823 | elapsed_ms: 10, |
| 824 | }; |
| 825 | let json = serde_json::to_string(&result).unwrap(); |
| 826 | assert!(json.contains("kg_search")); |
| 827 | assert!(json.contains(Class::WorkIntent.iri())); |
| 828 | // Empty content map should be skipped |
| 829 | assert!(!json.contains("content")); |
| 830 | } |
| 831 | |
| 832 | #[test] |
| 833 | fn test_plan_result_with_content_serialization() { |