MCPcopy Create free account
hub / github.com/AI45Lab/Code / test_agent_goal

Function test_agent_goal

core/src/planning/mod.rs:654–670  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

652
653 #[test]
654 fn test_agent_goal() {
655 let mut goal = AgentGoal::new("Complete task")
656 .with_criteria(vec!["Criterion 1".to_string(), "Criterion 2".to_string()]);
657
658 assert_eq!(goal.description, "Complete task");
659 assert_eq!(goal.success_criteria.len(), 2);
660 assert_eq!(goal.progress, 0.0);
661 assert!(!goal.achieved);
662
663 goal.update_progress(0.5);
664 assert_eq!(goal.progress, 0.5);
665
666 goal.mark_achieved();
667 assert!(goal.achieved);
668 assert_eq!(goal.progress, 1.0);
669 assert!(goal.achieved_at.is_some());
670 }
671
672 #[test]
673 fn test_complexity_levels() {

Callers

nothing calls this directly

Calls 3

with_criteriaMethod · 0.80
update_progressMethod · 0.80
mark_achievedMethod · 0.80

Tested by

no test coverage detected