mirror of
https://github.com/YspCoder/clawgo.git
synced 2026-05-04 05:37:28 +08:00
fix
This commit is contained in:
22
pkg/agent/system_summary_fallback_test.go
Normal file
22
pkg/agent/system_summary_fallback_test.go
Normal file
@@ -0,0 +1,22 @@
|
||||
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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user