Files
digital-psychology/apps/api/internal/star/natal/aspects_test.go
T
jackyu66gitandCursor bd22d9dddd feat: P1 合盘/星座/问答与测测完整设计包及模拟器取证工具
落地 synastry/star/ask API 与 H5 页面,补齐 cece-frontend-re complete-design 证据文档,并加入 Android 模拟器截图抓取脚本。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-03 11:37:53 +08:00

29 lines
584 B
Go

package natal
import (
"testing"
"time"
)
func TestAspectsDeterministic(t *testing.T) {
c, err := Compute(time.Date(1990, 5, 12, 0, 0, 0, 0, time.UTC), strPtr("12:00"), strPtr("北京"))
if err != nil {
t.Fatal(err)
}
a := Aspects(c)
b := Aspects(c)
if len(a) == 0 {
t.Fatal("expected some aspects")
}
if len(a) != len(b) || a[0].Label != b[0].Label {
t.Fatalf("not deterministic: %+v vs %+v", a[0], b[0])
}
for _, asp := range a {
if asp.Orb < 0 || asp.Orb > 8.1 {
t.Fatalf("orb out of range: %+v", asp)
}
}
}
func strPtr(s string) *string { return &s }