package rgb import ( "testing" "netdome.biz/paul/qmk-rgb/internal/via" ) func TestImpact80CatalogHasTheVendorEffectFamilies(t *testing.T) { catalog, ok := CatalogFor(0x36B0, 0x309F) if !ok { t.Fatal("CatalogFor() = not found") } logoWant := []string{"none", "wave", "fixed_wave", "spectrum", "breathing", "light", "shutdown"} for id, want := range logoWant { if got := catalog.EffectName(via.ChannelRgblight, uint8(id)); got != want { t.Errorf("logo effect %d = %q, want %q", id, got, want) } } backlightWant := map[int]string{ 0: "none", 1: "solid_color", 5: "breathing", 17: "rainbow_moving_chevron", 29: "pixel_flow", 37: "solid_reactive_multinexus", 45: "riverflow", } for id, want := range backlightWant { if got := catalog.EffectName(via.ChannelRgbMatrix, uint8(id)); got != want { t.Errorf("backlight effect %d = %q, want %q", id, got, want) } } } func TestImpact80LogoAndSideShareTheirEffectFamily(t *testing.T) { catalog, _ := CatalogFor(0x36B0, 0x309F) logo := catalog.Names(via.ChannelRgblight) side := catalog.Names(via.ChannelAudio) if len(logo) != len(side) { t.Fatalf("logo has %d effects, side has %d", len(logo), len(side)) } for i := range logo { if logo[i] != side[i] { t.Errorf("effect %d: logo %q, side %q", i, logo[i], side[i]) } } }