落地 synastry/star/ask API 与 H5 页面,补齐 cece-frontend-re complete-design 证据文档,并加入 Android 模拟器截图抓取脚本。 Co-authored-by: Cursor <cursoragent@cursor.com>
45 lines
843 B
Go
45 lines
843 B
Go
package ephemeris
|
|
|
|
import (
|
|
"testing"
|
|
"time"
|
|
)
|
|
|
|
func TestSunMay1990(t *testing.T) {
|
|
if !Ready() {
|
|
t.Fatal("ephemeris not ready")
|
|
}
|
|
// 1990-05-12 10:30 CST = 02:30 UTC
|
|
utc := time.Date(1990, 5, 12, 2, 30, 0, 0, time.UTC)
|
|
jd := JulianDayUT(utc)
|
|
lon, err := PlanetLon(jd, BodySun)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
// ~51° Taurus
|
|
if lon < 48 || lon > 55 {
|
|
t.Fatalf("sun lon=%.2f want ~51°", lon)
|
|
}
|
|
asc, err := Ascendant(jd, 31.23, 121.47)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
if asc < 0 || asc >= 360 {
|
|
t.Fatalf("bad asc %.2f", asc)
|
|
}
|
|
if Backend() == "" {
|
|
t.Fatal("empty backend")
|
|
}
|
|
}
|
|
|
|
func TestAllPlanetLons(t *testing.T) {
|
|
jd := JulianDayUT(time.Date(2000, 1, 1, 12, 0, 0, 0, time.UTC))
|
|
m, err := AllPlanetLons(jd)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
if len(m) != len(PlanetOrder) {
|
|
t.Fatalf("got %d", len(m))
|
|
}
|
|
}
|