2026-01-29 03:03:40 +08:00
|
|
|
package service
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"strings"
|
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func TestSanitizeOpenCodeText_RewritesCanonicalSentence(t *testing.T) {
|
|
|
|
|
in := "You are OpenCode, the best coding agent on the planet."
|
2026-01-31 01:40:38 +08:00
|
|
|
got := sanitizeSystemText(in)
|
2026-01-29 03:03:40 +08:00
|
|
|
require.Equal(t, strings.TrimSpace(claudeCodeSystemPrompt), got)
|
|
|
|
|
}
|
|
|
|
|
|
2026-01-31 01:40:38 +08:00
|
|
|
func TestSanitizeToolText_RewritesOpenCodeKeywords(t *testing.T) {
|
2026-01-29 03:03:40 +08:00
|
|
|
in := "OpenCode and opencode are mentioned."
|
2026-01-31 01:40:38 +08:00
|
|
|
got := sanitizeToolText(in)
|
2026-01-29 03:03:40 +08:00
|
|
|
require.Equal(t, "Claude Code and Claude are mentioned.", got)
|
|
|
|
|
}
|