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 }