mirror of
https://github.com/YspCoder/clawgo.git
synced 2026-04-13 04:27:28 +08:00
24 lines
802 B
Go
24 lines
802 B
Go
package agent
|
|
|
|
import (
|
|
"strings"
|
|
"testing"
|
|
)
|
|
|
|
func TestSummarizePlannedTaskProgressBodyPreservesUsefulLines(t *testing.T) {
|
|
t.Parallel()
|
|
|
|
body := "subagent 已写入 config.json。\npath: /root/.clawgo/config.json\nagent_id: tester\nrole: testing\ndisplay_name: Test Agent\ntool_allowlist: [filesystem shell]\nrouting_keywords: [test qa]\nsystem_prompt_file: agents/tester/AGENT.md"
|
|
out := summarizePlannedTaskProgressBody(body, 6, 320)
|
|
|
|
if !strings.Contains(out, "subagent 已写入 config.json。") {
|
|
t.Fatalf("expected title line, got:\n%s", out)
|
|
}
|
|
if !strings.Contains(out, "agent_id: tester") {
|
|
t.Fatalf("expected agent id line, got:\n%s", out)
|
|
}
|
|
if strings.Contains(out, "subagent 已写入 config.json。 path:") {
|
|
t.Fatalf("expected multi-line formatting, got:\n%s", out)
|
|
}
|
|
}
|