mirror of
https://github.com/YspCoder/clawgo.git
synced 2026-04-14 02:37:29 +08:00
23 lines
680 B
Go
23 lines
680 B
Go
package agent
|
|
|
|
import (
|
|
"strings"
|
|
"testing"
|
|
)
|
|
|
|
func TestBuildSystemTaskSummaryFallbackUsesPolicyPrefixes(t *testing.T) {
|
|
policy := defaultSystemSummaryPolicy()
|
|
policy.marker = "## Runtime Summary"
|
|
policy.completedPrefix = "- Done:"
|
|
policy.changesPrefix = "- Delta:"
|
|
policy.outcomePrefix = "- Result:"
|
|
|
|
out := buildSystemTaskSummaryFallback("task", "updated README.md\nbuild passed", policy)
|
|
if !strings.HasPrefix(out, "## Runtime Summary") {
|
|
t.Fatalf("expected custom marker, got: %s", out)
|
|
}
|
|
if !strings.Contains(out, "- Done:") || !strings.Contains(out, "- Delta:") || !strings.Contains(out, "- Result:") {
|
|
t.Fatalf("expected custom prefixes, got: %s", out)
|
|
}
|
|
}
|