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

Function test_load_from_file

core/src/skills/registry.rs:638–657  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

636
637 #[test]
638 fn test_load_from_file() -> anyhow::Result<()> {
639 let temp_dir = TempDir::new()?;
640 let skill_path = temp_dir.path().join("my-skill.md");
641
642 let mut file = std::fs::File::create(&skill_path)?;
643 writeln!(file, "---")?;
644 writeln!(file, "name: my-skill")?;
645 writeln!(file, "description: My custom skill")?;
646 writeln!(file, "---")?;
647 writeln!(file, "# My Skill")?;
648 drop(file);
649
650 let registry = SkillRegistry::new();
651 let skill = registry.load_from_file(&skill_path)?;
652
653 assert_eq!(skill.name, "my-skill");
654 assert_eq!(registry.len(), 1);
655
656 Ok(())
657 }
658
659 #[test]
660 fn test_to_system_prompt() {

Callers

nothing calls this directly

Calls 2

pathMethod · 0.80
load_from_fileMethod · 0.80

Tested by

no test coverage detected