落地 synastry/star/ask API 与 H5 页面,补齐 cece-frontend-re complete-design 证据文档,并加入 Android 模拟器截图抓取脚本。 Co-authored-by: Cursor <cursoragent@cursor.com>
37 lines
725 B
Go
37 lines
725 B
Go
package imagecard
|
|
|
|
import (
|
|
"encoding/json"
|
|
"strings"
|
|
"testing"
|
|
"time"
|
|
)
|
|
|
|
func TestDeckSize(t *testing.T) {
|
|
if len(deck) < 78 {
|
|
t.Fatalf("want ≥78 cards, got %d", len(deck))
|
|
}
|
|
if len(scenes) < 8 {
|
|
t.Fatalf("want ≥8 scenes, got %d", len(scenes))
|
|
}
|
|
}
|
|
|
|
func TestDrawLexicon(t *testing.T) {
|
|
out := Draw("u1", "情绪整理", true, time.Date(2026, 8, 2, 12, 0, 0, 0, time.UTC))
|
|
if len(out.Cards) != 3 {
|
|
t.Fatalf("want 3 cards, got %d", len(out.Cards))
|
|
}
|
|
raw, _ := json.Marshal(out)
|
|
for _, bad := range []string{"算命", "占卜"} {
|
|
if strings.Contains(string(raw), bad) {
|
|
t.Fatalf("forbidden %q", bad)
|
|
}
|
|
}
|
|
}
|
|
|
|
func TestScenes(t *testing.T) {
|
|
if len(Scenes()) < 3 {
|
|
t.Fatal("too few scenes")
|
|
}
|
|
}
|