feat: 完善标准 Skill 包底座
- 标准化 SKILL.md、资源模型、校验规则与安全限额 - 支持流式内容存储和单、多 Skill ZIP 双向编解码
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
package com.easyagents.skill.util;
|
||||
|
||||
import com.easyagents.skill.exception.SkillValidationException;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* SkillPaths 安全规范化测试。
|
||||
*/
|
||||
public class SkillPathsTest {
|
||||
|
||||
/**
|
||||
* 点路径段不能被静默剥离。
|
||||
*/
|
||||
@Test(expected = SkillValidationException.class)
|
||||
public void rejectLeadingDotSegment() {
|
||||
SkillPaths.normalize("./references/a.md");
|
||||
}
|
||||
|
||||
/**
|
||||
* 双向文本控制字符被拒绝。
|
||||
*/
|
||||
@Test(expected = SkillValidationException.class)
|
||||
public void rejectBidiFormatCharacter() {
|
||||
SkillPaths.normalize("references/a\u202Etxt.md");
|
||||
}
|
||||
|
||||
/**
|
||||
* Unicode 路径统一为 NFC。
|
||||
*/
|
||||
@Test
|
||||
public void normalizeUnicodeToNfc() {
|
||||
Assert.assertEquals("references/\u00e9.md", SkillPaths.normalize("references/e\u0301.md"));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user