package com.easyagents.skill.util;

import org.junit.Assert;
import org.junit.Test;

/**
 * {@link SkillResources} 规范存储表示测试。
 */
public class SkillResourcesTest {

    /**
     * HTML 的短扩展名与长扩展名都应作为严格 UTF-8 文本处理。
     */
    @Test
    public void recognizeBothHtmlExtensionsAsText() {
        Assert.assertTrue(SkillResources.isText(
                "references/page.htm", "application/octet-stream"));
        Assert.assertTrue(SkillResources.isText(
                "references/page.html", "application/octet-stream"));
    }

    /**
     * 资源目录只表达语义分类，不决定文本或二进制存储。
     */
    @Test
    public void determineContentModeIndependentlyFromTopLevelDirectory() {
        Assert.assertTrue(SkillResources.isText("assets/template.md", "application/octet-stream"));
        Assert.assertTrue(SkillResources.isText("custom/data.csv", "application/octet-stream"));
        Assert.assertFalse(SkillResources.isText("scripts/helper.bin", "application/octet-stream"));
    }
}
