package yijing import ( "testing" "time" ) func TestSeedStableSameInputs(t *testing.T) { bt := "10:30" now := time.Date(2026, 8, 11, 19, 0, 0, 0, time.FixedZone("CST", 8*3600)) a := Seed("1990-05-12", &bt, now) b := Seed("1990-05-12", &bt, now) if a.GuaIndex != b.GuaIndex || a.GuaName != b.GuaName || a.Line != b.Line { t.Fatalf("expected stable seed, got %+v vs %+v", a, b) } if a.GuaIndex < 1 || a.GuaIndex > 64 { t.Fatalf("gua out of range: %d", a.GuaIndex) } } func TestSeedChangesWithDay(t *testing.T) { d1 := time.Date(2026, 8, 11, 19, 0, 0, 0, time.FixedZone("CST", 8*3600)) d2 := time.Date(2026, 8, 12, 19, 0, 0, 0, time.FixedZone("CST", 8*3600)) a := Seed("1990-05-12", nil, d1) b := Seed("1990-05-12", nil, d2) if a.GuaIndex == b.GuaIndex && a.Line == b.Line { t.Fatalf("expected seed to change across days, both gua=%d line=%d", a.GuaIndex, a.Line) } }