package rhythm import ( "strings" "testing" "time" ) func TestBuildIncludesWuxingBars(t *testing.T) { birth := time.Date(1992, 6, 8, 0, 0, 0, 0, time.UTC) out := BuildWith(birth, "测", time.Date(2026, 8, 12, 12, 0, 0, 0, time.FixedZone("CST", 8*3600))) wx, ok := out.Summary["wuxing"].(map[string]any) if !ok { t.Fatal("missing wuxing") } bars, ok := wx["bars"].([]map[string]any) if !ok || len(bars) != 5 { t.Fatalf("bars=%#v", wx["bars"]) } if wx["strong_el"] == nil || wx["care_dir"] == nil { t.Fatalf("incomplete wuxing: %#v", wx) } prev, ok := out.Summary["blind_spots_preview"].([]string) if !ok || len(prev) == 0 { t.Fatalf("blind_spots_preview=%#v", out.Summary["blind_spots_preview"]) } for _, s := range prev { if strings.Contains(s, "深度版") { t.Fatalf("preview should not be upsell: %q", s) } } st, ok := out.Summary["solar_term"].(map[string]any) if !ok || st["name"] == nil { t.Fatalf("missing solar_term: %#v", out.Summary["solar_term"]) } }