Fix planned task splitting and progress summaries

This commit is contained in:
lpf
2026-03-06 19:22:57 +08:00
parent 623b401850
commit b4cf4a123b
3 changed files with 92 additions and 2 deletions

View File

@@ -0,0 +1,33 @@
package agent
import "testing"
func TestSplitPlannedSegmentsDoesNotSplitPlainNewlines(t *testing.T) {
t.Parallel()
content := "编写ai漫画创作平台demo\n让产品出方案方案出完让前端后端开始编写写完后交个测试过一下"
got := splitPlannedSegments(content)
if len(got) != 1 {
t.Fatalf("expected 1 segment, got %d: %#v", len(got), got)
}
}
func TestSplitPlannedSegmentsStillSplitsBullets(t *testing.T) {
t.Parallel()
content := "1. 先实现前端\n2. 再补测试"
got := splitPlannedSegments(content)
if len(got) != 2 {
t.Fatalf("expected 2 segments, got %d: %#v", len(got), got)
}
}
func TestSplitPlannedSegmentsStillSplitsSemicolons(t *testing.T) {
t.Parallel()
content := "先实现前端;再补测试"
got := splitPlannedSegments(content)
if len(got) != 2 {
t.Fatalf("expected 2 segments, got %d: %#v", len(got), got)
}
}