From 4f3b7c6d3fed2406e7a47be0f8196aa1ab3f2cee Mon Sep 17 00:00:00 2001 From: SHINE-six Date: Tue, 17 Mar 2026 12:49:32 +0800 Subject: [PATCH] fix(tests): update ResultTruncation_Unicode test to use valid CJK character --- pkg/tools/spawn_status_test.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkg/tools/spawn_status_test.go b/pkg/tools/spawn_status_test.go index cb8af126c..9c772d61a 100644 --- a/pkg/tools/spawn_status_test.go +++ b/pkg/tools/spawn_status_test.go @@ -236,8 +236,9 @@ func TestSpawnStatusTool_ResultTruncation_Unicode(t *testing.T) { provider := &MockLLMProvider{} manager := NewSubagentManager(provider, "test-model", "/tmp/test") - // Each "字" is 3 bytes; 400 runes = 1200 bytes — well over the 300-rune limit. - longResult := strings.Repeat("字", 400) + // Each CJK rune is 3 bytes; 400 runes = 1200 bytes — well over the 300-rune limit. + cjkChar := string(rune(0x5b57)) + longResult := strings.Repeat(cjkChar, 400) manager.mu.Lock() manager.tasks["subagent-1"] = &SubagentTask{ ID: "subagent-1", @@ -257,7 +258,7 @@ func TestSpawnStatusTool_ResultTruncation_Unicode(t *testing.T) { t.Errorf("Expected truncation indicator in output") } // The truncated result must be valid UTF-8 (no split rune boundaries). - if !strings.Contains(result.ForLLM, "字") { + if !strings.Contains(result.ForLLM, cjkChar) { t.Errorf("Expected CJK runes to appear intact in output") } }