()
| 746 | |
| 747 | #[test] |
| 748 | fn test_register_with_validator_accepts_valid() { |
| 749 | use crate::skills::validator::DefaultSkillValidator; |
| 750 | |
| 751 | let registry = SkillRegistry::new(); |
| 752 | registry.set_validator(Arc::new(DefaultSkillValidator::default())); |
| 753 | |
| 754 | let skill = Arc::new(Skill { |
| 755 | name: "my-custom-skill".to_string(), |
| 756 | description: "A valid skill".to_string(), |
| 757 | allowed_tools: Some("read(*), grep(*)".to_string()), |
| 758 | disable_model_invocation: false, |
| 759 | kind: SkillKind::Instruction, |
| 760 | content: "Help with code review.".to_string(), |
| 761 | tags: vec![], |
| 762 | version: None, |
| 763 | }); |
| 764 | |
| 765 | assert!(registry.register(skill).is_ok()); |
| 766 | assert_eq!(registry.len(), 1); |
| 767 | } |
| 768 | |
| 769 | #[test] |
| 770 | fn test_register_without_validator_accepts_anything() { |
nothing calls this directly
no test coverage detected