2026-06-23 16:55:10 +00:00
|
|
|
package prompt
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"strings"
|
|
|
|
|
"testing"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func TestComposeSystemOverlayFirst(t *testing.T) {
|
|
|
|
|
got, err := ComposeSystem("基礎 system")
|
|
|
|
|
if err != nil {
|
|
|
|
|
t.Fatal(err)
|
|
|
|
|
}
|
|
|
|
|
if !strings.Contains(got, "基礎 system") {
|
|
|
|
|
t.Fatalf("missing base: %q", got)
|
|
|
|
|
}
|
|
|
|
|
if !strings.Contains(got, overlaySeparator) {
|
|
|
|
|
t.Fatalf("missing separator: %q", got)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func TestStyle8DSystemIncludesSchema(t *testing.T) {
|
|
|
|
|
got, err := Style8DSystem()
|
|
|
|
|
if err != nil {
|
|
|
|
|
t.Fatal(err)
|
|
|
|
|
}
|
|
|
|
|
if !strings.Contains(got, "Threads 創作者風格研究員") || !strings.Contains(got, `"d1Tone"`) {
|
|
|
|
|
t.Fatalf("missing expected fragments: %q", got)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func TestIslanderSystemIncludesContext(t *testing.T) {
|
|
|
|
|
got, err := IslanderSystem("【目前頁面】\n- 路徑:/settings")
|
|
|
|
|
if err != nil {
|
|
|
|
|
t.Fatal(err)
|
|
|
|
|
}
|
|
|
|
|
if !strings.Contains(got, "島民嚮導") || !strings.Contains(got, "/settings") {
|
|
|
|
|
t.Fatalf("missing expected fragments: %q", got)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func TestAIChatSystemUsesDefault(t *testing.T) {
|
|
|
|
|
got, err := AIChatSystem("")
|
|
|
|
|
if err != nil {
|
|
|
|
|
t.Fatal(err)
|
|
|
|
|
}
|
|
|
|
|
if !strings.Contains(got, "巡樓管理台") {
|
|
|
|
|
t.Fatalf("got %q", got)
|
|
|
|
|
}
|
2026-06-24 10:02:42 +00:00
|
|
|
}
|