package com.gzzm.lobster.guardrails;

import org.junit.Test;

import static org.junit.Assert.*;

public class InternalInfoSanitizerTest {

    @Test
    public void builtinToolNamesAreMasked() {
        InternalInfoSanitizer s = new InternalInfoSanitizer();
        String out = s.sanitize("我将使用 oa_read_file 和 read_file 读取文件。");
        assertFalse(out.contains("oa_read_file"));
        assertFalse(out.contains("read_file"));
        assertTrue(out.contains("【内部能力】"));
    }

    @Test
    public void internalIdsAreMasked() {
        InternalInfoSanitizer s = new InternalInfoSanitizer();
        String id = "art_abcdef1234567890";
        String out = s.sanitize("工件 " + id + " 已生成");
        assertFalse(out.contains(id));
        assertTrue(out.contains("<id>"));
    }

    @Test
    public void plainTextUnchanged() {
        InternalInfoSanitizer s = new InternalInfoSanitizer();
        String out = s.sanitize("你好，世界。");
        assertEquals("你好，世界。", out);
    }
}
